MCPcopy
hub / github.com/e-p-armstrong/augmentoolkit / set_final_status

Function set_final_status

tasks.py:75–95  ·  view source on GitHub ↗

Sets the final status of a task in Redis.

(
    task_id: str, status: str, message: str, details: Optional[Dict] = None
)

Source from the content-addressed store, hash-verified

73
74# --- Helper Function for Setting Final Status in Redis ---
75def set_final_status(
76 task_id: str, status: str, message: str, details: Optional[Dict] = None
77):
78 """Sets the final status of a task in Redis."""
79 redis_key = f"status_for_task:{task_id}"
80 status_data = {
81 "status": status,
82 "message": message,
83 "details": details or {},
84 "timestamp": time.time(), # Add timestamp for potential debugging
85 }
86 try:
87 redis_client.set(redis_key, json.dumps(status_data), ex=FINAL_STATUS_TIMEOUT)
88 print(
89 f"Task {task_id}: Set final status in Redis ({redis_key}) to {status}. Message: {message}"
90 )
91 except Exception as e:
92 print(
93 f"Task {task_id}: Failed to set final status '{status}' in Redis ({redis_key}): {e}",
94 exc_info=True,
95 )
96
97
98@huey.task(context=True)

Callers 2

interrupt_or_revoke_taskFunction · 0.90
run_pipeline_taskFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected