diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-14 10:19:18 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-14 10:19:18 +0000 |
| commit | b101afa00bc28e1b55286145cb81e32a5b3decc9 (patch) | |
| tree | d42869f89e4916bb8dc36fd26c9ac5f888e042ac /src/git/mod.rs | |
| parent | b6c70f765dd02fb0297888d671e455df33d6fcb4 (diff) | |
feat(sync): add rejected events cache persistence and integrate with shutdown/startup
Implement save/restore functionality for rejected events cache and
integrate persistence with relay shutdown/startup lifecycle. Both
purgatory and rejected cache now survive relay restarts.
Key features:
- Serialize rejected events cache to JSON (rejected-events-cache.json)
- Save both hot cache (2min, full events) and cold index (7day, metadata)
- Restore with downtime adjustment (preserves remaining TTL)
- Graceful degradation (missing/corrupted files don't crash)
- File cleanup after successful restore
- Automatic restoration in SyncManager::new()
Integration:
- Shutdown hook saves both purgatory and rejected cache
- Startup hook restores both and re-queues repositories
- Non-fatal errors (logs warnings, continues on failure)
Files:
- src/sync/rejected_index.rs: save_to_disk/restore_from_disk methods
- src/sync/mod.rs: SyncManager integration and auto-restore
- src/main.rs: Shutdown/startup hooks for both caches
- tests/purgatory_persistence.rs: 17 integration tests
Tests: 13 unit tests + 17 integration tests covering full lifecycle
Diffstat (limited to 'src/git/mod.rs')
0 files changed, 0 insertions, 0 deletions