diff options
Diffstat (limited to 'src/remake/switch.rs')
| -rw-r--r-- | src/remake/switch.rs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/remake/switch.rs b/src/remake/switch.rs index 1a4dbf9..9cc1ca0 100644 --- a/src/remake/switch.rs +++ b/src/remake/switch.rs @@ -32,7 +32,7 @@ use super::delta::{self, ReplayStats}; use super::kind::Translator; use super::local::LocalStatus; use super::quarantine; -use super::records::{self, EpochRecord, Record, unix_millis}; +use super::records::{self, EpochRecord, Record}; use super::snapshot::{self, META_ROOT, REMAKES}; use super::vote; use crate::document::replica::Epoch; @@ -73,7 +73,8 @@ pub(crate) async fn run_worker<H: Host>(host: H) { async fn check<H: Host>(host: &H) { let local = host.current_epoch(); - host.remake().prune_archive(local.generation); + host.remake() + .prune_archive(local.generation, host.now_millis()); // While rejoining, the document is being filled from peers: its records are not // complete enough to act on. @@ -87,7 +88,7 @@ async fn check<H: Host>(host: &H) { content::prune( host, &all, - unix_millis(), + host.now_millis(), host.dormant_after().as_millis() as u64, ); let local_record = EpochRecord::from(local); @@ -144,7 +145,7 @@ async fn check<H: Host>(host: &H) { host.remake().set_status( &id, LocalStatus { - switched_at: Some(unix_millis()), + switched_at: Some(host.now_millis()), replayed_paths: Some(stats.replayed), failed_paths: Some(stats.failed), quarantine, @@ -257,8 +258,13 @@ async fn switch<H: Host>( &old, std::mem::take(&mut stats.quarantined), ); - host.remake() - .archive(previous, old, retention, expected.generation); + host.remake().archive( + previous, + old, + retention, + expected.generation, + host.now_millis(), + ); info!( remake = %id, |
