stage-9: heartbeat system with periodic checks

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
MoltBot Service
2026-02-13 16:40:39 +00:00
parent 24a4d87f8c
commit 0bc4b8cb3e
6 changed files with 527 additions and 1 deletions

10
cli.py
View File

@@ -405,6 +405,12 @@ def _cron_disable(name: str):
print(f"Job '{name}' not found.")
def cmd_heartbeat(args):
"""Run heartbeat health checks."""
from src.heartbeat import run_heartbeat
print(run_heartbeat())
def cmd_secrets(args):
"""Handle secrets subcommand."""
if args.secrets_action == "set":
@@ -509,6 +515,9 @@ def main():
secrets_sub.add_parser("test", help="Check required secrets")
# heartbeat
sub.add_parser("heartbeat", help="Run heartbeat health checks")
# cron
cron_parser = sub.add_parser("cron", help="Manage scheduled jobs")
cron_sub = cron_parser.add_subparsers(dest="cron_action")
@@ -554,6 +563,7 @@ def main():
cmd_channel(a) if a.channel_action else (channel_parser.print_help() or sys.exit(0))
),
"send": cmd_send,
"heartbeat": cmd_heartbeat,
"cron": lambda a: (
cmd_cron(a) if a.cron_action else (cron_parser.print_help() or sys.exit(0))
),