Add a `.sqlite` database to be used to store rollout metatdata (and later logs) This PR is phase 1: * Add the database and the required infrastructure * Add a backfill of the database * Persist the newly created rollout both in files and in the DB * When we need to get metadata or a rollout, consider the `JSONL` as the source of truth but compare the results with the DB and show any errors
10 lines
358 B
Rust
10 lines
358 B
Rust
use chrono::DateTime;
|
|
use chrono::Timelike;
|
|
use chrono::Utc;
|
|
use std::path::Path;
|
|
|
|
pub(crate) async fn file_modified_time_utc(path: &Path) -> Option<DateTime<Utc>> {
|
|
let modified = tokio::fs::metadata(path).await.ok()?.modified().ok()?;
|
|
let updated_at: DateTime<Utc> = modified.into();
|
|
Some(updated_at.with_nanosecond(0).unwrap_or(updated_at))
|
|
}
|