diff options
Diffstat (limited to 'crates/dinggerd/src/watcher.rs')
| -rw-r--r-- | crates/dinggerd/src/watcher.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/dinggerd/src/watcher.rs b/crates/dinggerd/src/watcher.rs index e87a7bf..a2f5ef1 100644 --- a/crates/dinggerd/src/watcher.rs +++ b/crates/dinggerd/src/watcher.rs @@ -180,6 +180,7 @@ pub fn advance( pub struct Watcher { tracks: HashMap<String, PaneTrack>, + snapshots: crate::snapshot::Recorder, /// Last published (queue, blocked, done, working); avoids rewriting the /// global options every tick. last_published: Option<(String, usize, usize, usize)>, @@ -192,6 +193,7 @@ impl Watcher { pub fn new(interval_secs: u64, sounds: bool, notifications: bool) -> Self { Self { tracks: HashMap::new(), + snapshots: Default::default(), last_published: None, interval_secs: interval_secs.max(1), sounds, @@ -221,6 +223,8 @@ impl Watcher { had_server = false; } } + // After the tick, so snapshots carry the states it just wrote. + self.snapshots.tick(unix_now()); debug!(ms = started.elapsed().as_millis() as u64, "tick"); hooks::wait_for_wake(std::time::Duration::from_secs(self.interval_secs)); } |
