MCPcopy Create free account
hub / github.com/ZingerLittleBee/ServerBee / insert_ping_record

Function insert_ping_record

crates/server/src/task/cleanup.rs:233–247  ·  view source on GitHub ↗

Insert a `ping_record` at `days_ago` (no FK on this table).

(db: &sea_orm::DatabaseConnection, days_ago: i64)

Source from the content-addressed store, hash-verified

231
232 /// Insert a `ping_record` at `days_ago` (no FK on this table).
233 async fn insert_ping_record(db: &sea_orm::DatabaseConnection, days_ago: i64) {
234 let time = Utc::now() - ChronoDuration::days(days_ago);
235 ping_record::ActiveModel {
236 id: sea_orm::NotSet,
237 task_id: Set("task-cleanup".to_string()),
238 server_id: Set("srv-cleanup".to_string()),
239 latency: Set(12.5),
240 success: Set(true),
241 error: Set(None),
242 time: Set(time),
243 }
244 .insert(db)
245 .await
246 .expect("insert ping_record");
247 }
248
249 /// Insert an `audit_log` at `days_ago` (no FK on this table).
250 async fn insert_audit_log(db: &sea_orm::DatabaseConnection, days_ago: i64) {

Calls

no outgoing calls

Tested by

no test coverage detected