Skip to content

feat: one-command supervisor for bot, updater, and jobs - #7

Closed
kinton wants to merge 1 commit into
mainfrom
cursor/process-supervisor-d56e
Closed

feat: one-command supervisor for bot, updater, and jobs#7
kinton wants to merge 1 commit into
mainfrom
cursor/process-supervisor-d56e

Conversation

@kinton

@kinton kinton commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What

python main.py is still the only start command. That process is now a supervisor: it runs bot, updater, and jobs as children and restarts a crashed role without taking the others down.

Deploy is unchanged: supervisorctl restart yourcast in .github/workflows/main.yml.

Why

A dead backup/Patreon/updater thread used to call supervisorctl restart yourcast and bounce receive with it.

Behavior

  • bot — Telethon receive, answers, episode send workers
  • updater — podcast circle; crash sets a flag so the next start skips the channel that killed it
  • jobs — backup, balance watcher, Patreon, rec cleaner

Shelve access is flock’d so bot and updater can share FSM/cursor. A dead send-thread in the bot process signals only that process; the parent restarts bot, not the whole tree.

python main.py --role bot|updater|jobs is debug-only.

Tests

python app/core/test_process_supervisor.py — dummy children, no Telegram: crashed role restarts, sibling pid unchanged, stop kills children, inter-process lock.

Open in Web Open in Cursor 

@kinton
kinton marked this pull request as ready for review September 3, 2026 09:28
python main.py still starts everything. A crashed updater or jobs
process is restarted without taking receive down. Deploy stays
supervisorctl restart yourcast.

Co-authored-by: Kovalenko K. <kintonkk@gmail.com>
@kinton

kinton commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #12: Telethon sessions are per-role, updater cursor is sqlite, start_new_session is off, supervisor.conf has stopasgroup/killasgroup.

@kinton kinton closed this Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants