From 9d7680cbca2fd8e5be4fca8a0faadc83cdaaf539 Mon Sep 17 00:00:00 2001 From: Bittrance Date: Sat, 30 Sep 2023 23:11:01 +0200 Subject: [PATCH] SystemTime appears non-linear on MaxOS? --- src/task/scheduled.rs | 2 +- src/testutils.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/task/scheduled.rs b/src/task/scheduled.rs index fe90f7f..0ca4c12 100644 --- a/src/task/scheduled.rs +++ b/src/task/scheduled.rs @@ -30,7 +30,7 @@ impl ScheduledTask { } pub fn is_eligible(&self) -> bool { - self.worker.is_none() && self.state.next_run < SystemTime::now() + self.worker.is_none() && SystemTime::now() >= self.state.next_run } pub fn is_running(&self) -> bool { diff --git a/src/testutils.rs b/src/testutils.rs index 9347ede..973cd47 100644 --- a/src/testutils.rs +++ b/src/testutils.rs @@ -37,7 +37,7 @@ impl Workload for TestWorkload { } fn interval(&self) -> Duration { - Duration::from_millis(25) + Duration::from_secs(1) } fn work(&self, _workdir: PathBuf, _current_sha: ObjectId) -> Result {