refactor: single now_unix in hive_sh4re::wire_time
replaces 15 per-module copies (now_unix/now_secs) across hive-c0re and hive-ag3nt; wire_time already owns the epoch-seconds convention
This commit is contained in:
parent
d190420946
commit
c84028ddcf
16 changed files with 45 additions and 125 deletions
|
|
@ -29,6 +29,7 @@ use std::collections::{HashMap, VecDeque};
|
|||
use std::sync::Mutex;
|
||||
|
||||
use tokio::sync::Notify;
|
||||
use hive_sh4re::wire_time::now_unix;
|
||||
|
||||
pub use model::{
|
||||
Dag, DagSpec, DagView, DepWhen, Node, NodeId, NodeKind, PermPayload, Source, State, Template,
|
||||
|
|
@ -566,11 +567,3 @@ impl JobQueue {
|
|||
}
|
||||
}
|
||||
|
||||
/// Current unix timestamp in seconds.
|
||||
fn now_unix() -> i64 {
|
||||
std::time::SystemTime::now()
|
||||
.duration_since(std::time::UNIX_EPOCH)
|
||||
.ok()
|
||||
.and_then(|d| i64::try_from(d.as_secs()).ok())
|
||||
.unwrap_or(0)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue