Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7b5dd8b620 |
29
tasks.py
29
tasks.py
@@ -2126,3 +2126,32 @@ def cross_review_prs():
|
||||
continue
|
||||
|
||||
return {"reviews": len(results), "details": results}
|
||||
|
||||
@huey.periodic_task(crontab(minute="*/15"))
|
||||
def resurrection_tick():
|
||||
"""Force Multiplier 11: The Lazarus Heartbeat (Self-Healing Services).
|
||||
|
||||
Checks critical services and restarts them if they are dead.
|
||||
"""
|
||||
services = [
|
||||
"com.timmy.gitea-event-watcher",
|
||||
"com.timmy.gemini-worker",
|
||||
"com.timmy.grok-worker",
|
||||
"com.hermes.gateway"
|
||||
]
|
||||
|
||||
for service in services:
|
||||
try:
|
||||
# Check if service is running
|
||||
res = subprocess.run(["launchctl", "list", service], capture_output=True, text=True)
|
||||
if res.returncode != 0:
|
||||
audit_log("resurrection_start", "system", {"service": service}, confidence="High")
|
||||
# Attempt restart (assuming plist is in standard location)
|
||||
plist_path = f"/Library/LaunchDaemons/{service}.plist"
|
||||
if not os.path.exists(plist_path):
|
||||
plist_path = f"~/Library/LaunchAgents/{service}.plist"
|
||||
|
||||
subprocess.run(["launchctl", "load", "-w", os.path.expanduser(plist_path)])
|
||||
audit_log("resurrection_complete", "system", {"service": service}, confidence="Medium")
|
||||
except Exception as e:
|
||||
audit_log("resurrection_failed", "system", {"service": service, "error": str(e)}, confidence="Low")
|
||||
|
||||
Reference in New Issue
Block a user