Formatting
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user