Files
dj/integration-work/historical_cleanup_helper_health.py
2026-11-13 11:46:25 +08:00

8 lines
560 B
Python

import json,subprocess,pathlib
active=subprocess.check_output(['systemctl','--user','is-active','huobao-video-cleanup.service'],text=True).strip()
assert active=='active'
log=subprocess.check_output(['journalctl','--user','-u','huobao-video-cleanup.service','--since','2 minutes ago','--no-pager','-o','cat'],text=True,stderr=subprocess.DEVNULL)
errors=[line for line in log.splitlines() if 'history-reconcile-retry' in line or 'Traceback' in line]
assert not errors,'Cleanup helper reported an error'
print(json.dumps({'active':True,'historyGuardErrors':0}))