debug(worker): persistent breadcrumb in nspd_geo_log on worker_ready
This commit is contained in:
parent
f539e0e414
commit
17feaa408e
1 changed files with 19 additions and 0 deletions
|
|
@ -247,6 +247,25 @@ def _resume_zombie_runs(sender=None, **_kwargs) -> None:
|
||||||
logger.info("worker_ready: resume scan starting")
|
logger.info("worker_ready: resume scan starting")
|
||||||
from sqlalchemy import text
|
from sqlalchemy import text
|
||||||
|
|
||||||
|
# Persistent breadcrumb: write to nspd_geo_log so we can confirm via DB
|
||||||
|
# query whether worker_ready actually fired (independent of container logs).
|
||||||
|
try:
|
||||||
|
from app.core.db import SessionLocal
|
||||||
|
|
||||||
|
_db = SessionLocal()
|
||||||
|
try:
|
||||||
|
_db.execute(
|
||||||
|
text(
|
||||||
|
"INSERT INTO nspd_geo_log (job_id, level, stage, message) "
|
||||||
|
"VALUES (0, 'info', 'worker_ready', 'worker_ready signal fired')"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
_db.commit()
|
||||||
|
finally:
|
||||||
|
_db.close()
|
||||||
|
except Exception as _e:
|
||||||
|
logger.warning("worker_ready: breadcrumb insert failed: %s", _e)
|
||||||
|
|
||||||
from app.core.db import SessionLocal
|
from app.core.db import SessionLocal
|
||||||
|
|
||||||
db = SessionLocal()
|
db = SessionLocal()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue