use std::time::Duration;
use ruststream::Outgoing;
use serde::{Deserialize, Serialize};
use sqlx::AssertSqlSafe;
pub(crate) const POLL: Duration = Duration::from_millis(20);
pub(crate) const LEASE: Duration = Duration::from_secs(1);
#[derive(Debug, Serialize, Deserialize, PartialEq, Outgoing)]
pub(crate) struct Job {
pub(crate) n: i64,
}
pub(crate) const JOB: Job = Job { n: 7 };
pub(crate) fn audit(job: &Job, note: &str) -> AssertSqlSafe<String> {
AssertSqlSafe(format!(
"INSERT INTO audit (job_id, note) VALUES ({}, '{note}')",
job.n
))
}