phase 10
This commit is contained in:
@@ -31,8 +31,16 @@ def ts():
|
||||
return datetime.now(timezone.utc).isoformat()
|
||||
|
||||
|
||||
RUN_CONTEXT = {}
|
||||
|
||||
|
||||
def set_run_context(run_id: str, parent_job_id: str, run_type: str = "initial"):
|
||||
RUN_CONTEXT.update({"run_id": run_id, "parent_job_id": parent_job_id, "run_type": run_type})
|
||||
|
||||
|
||||
def push(r, key, event):
|
||||
event["ts"] = event.get("ts", ts())
|
||||
event.update(RUN_CONTEXT)
|
||||
r.rpush(key, json.dumps(event))
|
||||
return event
|
||||
|
||||
@@ -85,7 +93,11 @@ def main():
|
||||
r.delete(key)
|
||||
delay = args.delay
|
||||
|
||||
run_id = f"{args.job[:8]}-r1"
|
||||
set_run_context(run_id=run_id, parent_job_id=args.job, run_type="initial")
|
||||
|
||||
logger.info("Full escalation pipeline simulation → %s", key)
|
||||
logger.info("Run: %s (parent: %s)", run_id, args.job)
|
||||
logger.info("Open: http://mpr.local.ar/detection/?job=%s", args.job)
|
||||
input("\nPress Enter to start...")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user