use std::sync::Arc;
pub use ag_store::*;
use crate::infra::clock;
pub const DB_DIR: &str = "db";
pub const DB_FILE: &str = "agentty.db";
pub fn timestamp_source_from_environment() -> Arc<dyn TimestampSource> {
let clock = clock::from_environment();
Arc::new(move || clock::unix_timestamp_seconds(clock.as_ref()))
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn environment_timestamp_source_returns_a_unix_timestamp() {
let timestamp_source = timestamp_source_from_environment();
let timestamp = timestamp_source.now_timestamp_seconds();
assert!(timestamp > 0);
}
}