hive-sh4re/hive-bash-mcp/hive-agent: retype TaskFile timestamps to DateTime<Utc>, drop now_unix from these crates
This commit is contained in:
parent
d6ea92085a
commit
2122e23d81
7 changed files with 30 additions and 22 deletions
|
|
@ -38,11 +38,12 @@ fn format_task(task: &TaskFile) -> String {
|
|||
let _ = write!(out, ", exit={code}");
|
||||
}
|
||||
if let (Some(started), None) = (task.started_at, task.completed_at) {
|
||||
let now = hive_sh4re::wire_time::now_unix();
|
||||
let _ = write!(out, ", running for {}s", now - started);
|
||||
let elapsed = (chrono::Utc::now() - started).num_seconds();
|
||||
let _ = write!(out, ", running for {elapsed}s");
|
||||
}
|
||||
if let (Some(completed), Some(started)) = (task.completed_at, task.started_at) {
|
||||
let _ = write!(out, ", took {}s", completed - started);
|
||||
let took = (completed - started).num_seconds();
|
||||
let _ = write!(out, ", took {took}s");
|
||||
}
|
||||
|
||||
let out_file = crate::paths::task_out(&task.id);
|
||||
|
|
@ -295,8 +296,8 @@ mod status_hint_tests {
|
|||
cmd: "echo hi".to_owned(),
|
||||
timeout_secs: None,
|
||||
status,
|
||||
created_at: 1,
|
||||
started_at: Some(1),
|
||||
created_at: chrono::DateTime::from_timestamp(1, 0).unwrap_or_default(),
|
||||
started_at: Some(chrono::DateTime::from_timestamp(1, 0).unwrap_or_default()),
|
||||
completed_at: None,
|
||||
exit_code: None,
|
||||
stdout_tail: None,
|
||||
|
|
|
|||
Loading…
Reference in a new issue