diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-14 10:18:47 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-14 10:18:47 +0000 |
| commit | b6c70f765dd02fb0297888d671e455df33d6fcb4 (patch) | |
| tree | 6458d711ef9a7776c31bdb108c39930cbcc3bd68 /src/git/mod.rs | |
| parent | 7dba18eb9ae64d429fef1a1f5437981efefb86b6 (diff) | |
feat(purgatory): add persistence to survive relay restarts
Implement save/restore functionality for purgatory state to prevent
event loss during relay restarts. Events in purgatory (state events,
PR events, and expired events) are now saved to disk on graceful
shutdown and restored on startup.
Key features:
- Serialize purgatory state to JSON (purgatory-state.json)
- Time conversion helpers for Instant <-> Duration serialization
- Restore with downtime adjustment (preserves remaining TTL)
- Graceful degradation (missing/corrupted files don't crash)
- File cleanup after successful restore
- get_all_identifiers() for re-queueing after restore
Files:
- src/purgatory/persistence.rs: Time conversion helpers
- src/purgatory/types.rs: Serialization derives
- src/purgatory/mod.rs: save_to_disk/restore_from_disk methods
Tests: 15 unit tests covering serialization, downtime, edge cases
Diffstat (limited to 'src/git/mod.rs')
0 files changed, 0 insertions, 0 deletions