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:
müde 2026-07-06 21:58:32 +02:00
commit c84028ddcf
16 changed files with 45 additions and 125 deletions

View file

@ -10,6 +10,7 @@ use hive_sh4re::Message;
use crate::coordinator::Coordinator;
use crate::scheduled_prompts::Schedule;
use hive_sh4re::wire_time::now_unix;
/// Per-tick cap. Each schedule fires once per tick at most;
/// 100/tick × 5s tick = sustained throughput cap of ~20/sec,
@ -236,13 +237,6 @@ fn notify_operator_missing_target(coord: &Coordinator, schedule: &Schedule, targ
}
}
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)
}
/// Per-target outcome counts for one `fire_now` invocation.
/// Returned to the operator so the dashboard can render