feat: persist rec/update jobs in a SQLite outbox - #11
Closed
kinton wants to merge 2 commits into
Closed
Conversation
kinton
marked this pull request as ready for review
September 3, 2026 10:40
User-triggered episode sends and feed updates lived only in memory queues, so a restart dropped them. Store JSON-safe payloads in send_outbox, claim/lease them into the existing balancer, and restore pending rows on process start. Co-authored-by: Kovalenko K. <kintonkk@gmail.com>
Startup reclaim+drain would otherwise pick up a row already claimed onto the memory queue and send it twice. Leave rows pending until RecordBalancer has finished restoring the outbox. Co-authored-by: Kovalenko K. <kintonkk@gmail.com>
cursor
Bot
force-pushed
the
cursor/send-outbox-d56e
branch
from
September 3, 2026 15:40
cf3aa7e to
eb3819c
Compare
7 tasks
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A process restart used to drop pending episode sends and user-triggered feed updates: they lived only in
queue.QueueinsideRecordBalancer.send_outboxstores a JSON-saferec/updatepayload (pending→leased→done/failed). The in-memory balancer is still used in-process; on start expired/forced leases are reclaimed and pending rows are drained. Telegram upload/send logic is unchanged.Details
db/migrations/00013_send_outbox.py.recstores link / chat maps / podcastInfo.updatestoreschat_id,language_code,is_user_have_bot_subscription(no Telethon objects).BEGIN IMMEDIATE. After 8 attempts the row isfailed. FloodWait can delayavailable_at.python main.py/supervisorctl restart yourcast.Tests
venv/bin/python db/test_send_outbox.py— temp file DB only.Left alone
ETag (PR #9), Bot API polling (PR #5), process supervisor (PR #7).