Skip to content

Comments

fix: checkpoint sync_status after every N batches for crash-safe resume#77

Merged
GeiserX merged 2 commits intomasterfrom
fix/backup-resume-checkpoint
Feb 16, 2026
Merged

fix: checkpoint sync_status after every N batches for crash-safe resume#77
GeiserX merged 2 commits intomasterfrom
fix/backup-resume-checkpoint

Conversation

@GeiserX
Copy link
Owner

@GeiserX GeiserX commented Feb 16, 2026

Summary

  • Moves sync_status updates from end-of-chat to after every CHECKPOINT_INTERVAL batch inserts (default: 1), so backup resumes from the last committed batch instead of re-fetching all messages on crash/restart
  • Extracts duplicated batch-commit logic into _commit_batch() helper and removes the message accumulation list (lower memory usage on large chats)
  • Adds configurable CHECKPOINT_INTERVAL env var (documented in README, .env.example, docker-compose.yml)

Test plan

  • 46 unit tests pass (including 6 new checkpoint tests + 4 config tests)
  • Build :dev image via CI and deploy to dev instance
  • Verify backup runs and checkpoints correctly in logs
  • Simulate crash during backup, confirm resume starts from last checkpoint

Closes #76

Moves sync_status updates from end-of-chat to after every
CHECKPOINT_INTERVAL batch inserts (default: 1). On crash/restart,
backup resumes from the last committed batch instead of re-fetching
all messages for the current chat.

Also extracts duplicated batch-commit logic into _commit_batch() helper,
removes the message accumulation list (saves memory on large chats),
and adds CHECKPOINT_INTERVAL env var with docs and tests.

Closes #76
@github-actions
Copy link

🐳 Dev images published!

  • drumsergio/telegram-archive:dev
  • drumsergio/telegram-archive-viewer:dev

The dev/test instance will pick up these changes automatically (Portainer GitOps).

To test locally:

docker pull drumsergio/telegram-archive:dev
docker pull drumsergio/telegram-archive-viewer:dev

@github-actions
Copy link

🐳 Dev images published!

  • drumsergio/telegram-archive:dev
  • drumsergio/telegram-archive-viewer:dev

The dev/test instance will pick up these changes automatically (Portainer GitOps).

To test locally:

docker pull drumsergio/telegram-archive:dev
docker pull drumsergio/telegram-archive-viewer:dev

@GeiserX GeiserX merged commit 5c0aac2 into master Feb 16, 2026
7 of 8 checks passed
@GeiserX GeiserX deleted the fix/backup-resume-checkpoint branch February 16, 2026 20:42
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.

[Bug]: Backup doesn't resume

1 participant