hive-c0re: finish chrono-clock migration

This commit is contained in:
damocles 2026-08-01 23:55:00 +02:00 committed by mara
commit 9293c5d580
14 changed files with 82 additions and 78 deletions

View file

@ -18,7 +18,7 @@ use std::path::Path;
use std::sync::Mutex;
use anyhow::{Context, Result};
use hive_sh4re::wire_time::now_unix;
use chrono::Utc;
use rusqlite::{Connection, OptionalExtension, params};
const SCHEMA: &str = "
@ -129,7 +129,7 @@ impl PowerStore {
conn.execute(
"INSERT INTO agent_power (agent, wanted, updated_at) VALUES (?1, ?2, ?3)
ON CONFLICT(agent) DO UPDATE SET wanted = ?2, updated_at = ?3",
params![agent, wanted.as_str(), now_unix()],
params![agent, wanted.as_str(), Utc::now().timestamp()],
)
.context("upsert agent_power")?;
Ok(())