Change `INSTANT.epoch()` to now - 1 day.
Some services (like focus), use `DInstant::EPOCH` to initialize timestamps and then compare it to `INSTANT.now`. This caused a sporadic bug where highlight was enabled for the first focus event in a test run.
This commit is contained in:
parent
93bfa2face
commit
2d071a1f96
|
@ -27,7 +27,7 @@ impl INSTANT {
|
|||
DInstant(self.epoch().elapsed())
|
||||
}
|
||||
|
||||
/// Instant of first usage of the [`INSTANT`] service in the process.
|
||||
/// Instant of first usage of the [`INSTANT`] service in the process, minus one day.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
|
@ -36,7 +36,7 @@ impl INSTANT {
|
|||
if let Some(t) = *EPOCH.read() {
|
||||
return t;
|
||||
}
|
||||
*EPOCH.write().get_or_insert_with(Instant::now)
|
||||
*EPOCH.write().get_or_insert_with(|| Instant::now() - Duration::from_secs(60 * 60 * 24))
|
||||
}
|
||||
|
||||
/// Defines how the `now` value updates.
|
||||
|
|
Loading…
Reference in New Issue