Compare commits
1 Commits
76de1985aa
...
b2c426400b
Author | SHA1 | Date | |
---|---|---|---|
|
b2c426400b |
@ -6,16 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.3.0] - 2024-12-13
|
||||
## [0.3.0] - 2024-11-17
|
||||
|
||||
### Added
|
||||
- allow job to start immediately
|
||||
- rename and publish
|
||||
|
||||
### Fixed
|
||||
- test can now run at least 2 times, initial and then via. delay
|
||||
- with child token as well
|
||||
|
||||
## [0.2.0] - 2024-08-02
|
||||
|
||||
### Added
|
||||
|
@ -34,22 +34,6 @@ where
|
||||
|
||||
async move {
|
||||
let mut wait = interval;
|
||||
let start = std::time::Instant::now();
|
||||
|
||||
tracing::debug!("running job");
|
||||
let child_token = cancellation_token.child_token();
|
||||
if let Err(e) = drifter.execute(child_token).await {
|
||||
tracing::error!("drift job failed with error: {}, stopping routine", e);
|
||||
cancellation_token.cancel();
|
||||
}
|
||||
|
||||
let elapsed = start.elapsed();
|
||||
wait = interval.saturating_sub(elapsed);
|
||||
tracing::debug!(
|
||||
"job took: {}ms, waiting: {}ms for next run",
|
||||
elapsed.as_millis(),
|
||||
wait.as_millis()
|
||||
);
|
||||
|
||||
loop {
|
||||
let child_token = cancellation_token.child_token();
|
||||
@ -203,7 +187,7 @@ mod tests {
|
||||
assert!(token.is_cancelled());
|
||||
|
||||
let counter = drifter.counter.lock().unwrap();
|
||||
assert_eq!(*counter, 2);
|
||||
assert_eq!(*counter, 1);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user