Formatting

This commit is contained in:
2026-04-19 15:35:10 +02:00
parent 041f9015ca
commit 0d5c2f5888
42 changed files with 612 additions and 357 deletions
+6 -6
View File
@@ -43,8 +43,8 @@ pub async fn run_startup_cleanup(
marker_retention: Duration,
orphan_audio_retention: Duration,
) {
let marker_cutoff = OffsetDateTime::now_utc()
- time::Duration::seconds(marker_retention.as_secs() as i64);
let marker_cutoff =
OffsetDateTime::now_utc() - time::Duration::seconds(marker_retention.as_secs() as i64);
match store.cleanup_stale(marker_cutoff).await {
Ok(n) if n > 0 => info!(count = n, "startup cleanup: stale markers removed"),
Ok(_) => {}
@@ -61,8 +61,8 @@ pub async fn run_startup_cleanup(
#[cfg(test)]
mod tests {
use super::*;
use crate::upload::{write_sidecar, PendingUpload};
use filetime::{set_file_mtime, FileTime};
use crate::upload::{PendingUpload, write_sidecar};
use filetime::{FileTime, set_file_mtime};
use tempfile::TempDir;
use uuid::Uuid;
@@ -114,8 +114,8 @@ mod tests {
run_startup_cleanup(
&store,
&pending_dir,
Duration::from_secs(3600), // markers older than 1h: nuke
Duration::from_secs(3600), // orphans older than 1h: nuke
Duration::from_secs(3600), // markers older than 1h: nuke
Duration::from_secs(3600), // orphans older than 1h: nuke
)
.await;