Compare commits

..

3 Commits

Author SHA1 Message Date
cuddle-please
368720bb3c chore(release): 0.3.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-27 12:32:03 +00:00
ad0081846e fix: time formatting
All checks were successful
continuous-integration/drone/push Build is passing
2025-03-27 13:31:45 +01:00
b75a3da94d chore(release): v0.3.1 (#6)
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
chore(release): 0.3.1

Co-authored-by: cuddle-please <bot@cuddle.sh>
Reviewed-on: #6
2025-03-27 13:08:47 +01:00
4 changed files with 11 additions and 5 deletions

View File

@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [0.3.2] - 2025-03-27
### Fixed
- time formatting
## [0.3.1] - 2025-03-27
### Added

2
Cargo.lock generated
View File

@ -249,7 +249,7 @@ dependencies = [
[[package]]
name = "nodrift"
version = "0.3.0"
version = "0.3.1"
dependencies = [
"anyhow",
"async-trait",

View File

@ -3,7 +3,7 @@ members = ["crates/*"]
resolver = "2"
[workspace.package]
version = "0.3.1"
version = "0.3.2"
[workspace.dependencies]
drift = { path = "crates/drift" }

View File

@ -1,7 +1,8 @@
use std::{sync::Arc, time::Duration};
use anyhow::Context;
use async_trait::async_trait;
use chrono::{DateTime, Local};
use chrono::{DateTime, Local, TimeDelta};
use std::future::Future;
use tokio::time;
use tokio_util::sync::CancellationToken;
@ -76,9 +77,9 @@ where
wait = interval.saturating_sub(elapsed);
let now: DateTime<Local> = Local::now();
let next: Option<DateTime<Local>> = std::time::SystemTime::now().checked_add(wait).map(|next| next.into());
let next: Option<DateTime<Local>> = now.checked_add_signed(TimeDelta::from_std(wait).expect("to be able to convert duration into time delta"));
tracing::debug!(?now, ?next, "job took: {}ms, waiting: {}ms for next run", elapsed.as_millis(), wait.as_millis() );
tracing::debug!(now=now.to_string(), next=next.map(|n| n.to_string()), "job took: {}ms, waiting: {}ms for next run", elapsed.as_millis(), wait.as_millis() );
}
}