forge
Explore
Log in

Don't you dare go Hollow

⏰ backup: an attempt stamped in the future counts as due

Browse files at this commit

d4353ee5a1553edbe763e4da8aaea59e66b68239Ahmet Kaan GümüşParent: fdb2a7b
crates/in-web/src/backup.rsmodified+3 -1
@@ -144,7 +144,9 @@ async fn record_outcome(store: &Store, outcome: &in_core::error::Result<std::pat
144144 /// have a fixed width, so comparing them as text compares their times.
145145 pub fn is_due(last_attempt: Option<&str>, interval_hours: u32) -> bool {
146146 let interval = Duration::from_secs(u64::from(interval_hours) * 60 * 60);
147- last_attempt.is_none_or(|stamp| stamp < stamp_before(interval).as_str())
147+ // An attempt stamped in the future means the clock went back: run rather than wait for it.
148+ let now = now_stamp();
149+ last_attempt.is_none_or(|stamp| stamp < stamp_before(interval).as_str() || stamp > now.as_str())
148150 }
149151
150152 /// True when there is no successful backup within the limit: [`STALE_AFTER`] or two backup intervals,