fix(runtime): restore lifecycle and Telegram verification
All checks were successful
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 3m17s
CD Pipeline / build-and-deploy (push) Successful in 13m9s
CD Pipeline / post-deploy-checks (push) Successful in 1m59s

This commit is contained in:
ogt
2026-07-15 03:27:00 +08:00
parent 915277d149
commit 05ddd1538e
5 changed files with 105 additions and 11 deletions

View File

@@ -623,7 +623,35 @@ async def _main() -> None:
backup_restore_legacy_backfill_task: asyncio.Task[Any] | None = None
security_maintenance_tasks: list[asyncio.Task[Any]] = []
agent99_controlled_dispatch_reconciler_task: asyncio.Task[Any] | None = None
incident_lifecycle_reconciler_task: asyncio.Task[Any] | None = None
mcp_version_lifecycle_task: asyncio.Task[Any] | None = None
# Production API pods reserve their DB pool for serving requests. This
# singleton worker therefore owns the existing bounded, fail-closed
# lifecycle reconciler. It resolves at most one configured batch per pass
# and independently reads current Prometheus firing state before treating
# inactive alerts as closure candidates.
from src.jobs.incident_lifecycle_reconciler import (
BATCH_LIMIT as INCIDENT_LIFECYCLE_RECONCILER_BATCH_LIMIT,
)
from src.jobs.incident_lifecycle_reconciler import (
INTERVAL_SECONDS as INCIDENT_LIFECYCLE_RECONCILER_INTERVAL,
)
from src.jobs.incident_lifecycle_reconciler import (
run_incident_lifecycle_reconciler_loop,
)
incident_lifecycle_reconciler_task = asyncio.create_task(
run_incident_lifecycle_reconciler_loop(),
name="run_incident_lifecycle_reconciler_loop",
)
logger.info(
"signal_worker_incident_lifecycle_reconciler_started",
owner="signal_worker",
interval_seconds=INCIDENT_LIFECYCLE_RECONCILER_INTERVAL,
batch_limit=INCIDENT_LIFECYCLE_RECONCILER_BATCH_LIMIT,
direct_incident_closure_performed=False,
)
if settings.ENABLE_AWOOOP_ANSIBLE_CANDIDATE_BACKFILL_WORKER:
from src.jobs.awooop_ansible_candidate_backfill_job import (
run_awooop_ansible_candidate_backfill_loop,
@@ -794,6 +822,12 @@ async def _main() -> None:
await agent99_controlled_dispatch_reconciler_task
except asyncio.CancelledError:
pass
if incident_lifecycle_reconciler_task is not None:
incident_lifecycle_reconciler_task.cancel()
try:
await incident_lifecycle_reconciler_task
except asyncio.CancelledError:
pass
if mcp_version_lifecycle_task is not None:
mcp_version_lifecycle_task.cancel()
try: