sweeper: tracing span
This commit is contained in:
parent
0c7f7c3a22
commit
7e8844c89a
1 changed files with 19 additions and 13 deletions
|
@ -1,12 +1,16 @@
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
|
use tracing::{info_span, Instrument};
|
||||||
|
|
||||||
use crate::state::AppState;
|
use crate::state::AppState;
|
||||||
|
|
||||||
/// Spawn a repeating task that will clean files periodically
|
/// Spawn a repeating task that will clean files periodically
|
||||||
pub fn spawn(_state: AppState) {
|
pub fn spawn(_state: AppState) {
|
||||||
tokio::spawn(async move {
|
tokio::spawn(
|
||||||
|
async move {
|
||||||
loop {
|
loop {
|
||||||
tokio::time::sleep(Duration::from_secs(15 * 60)).await;
|
tokio::time::sleep(Duration::from_secs(15 * 60)).await;
|
||||||
|
|
||||||
tracing::info!("Cleaning Sweep!");
|
tracing::info!("Cleaning Sweep!");
|
||||||
|
|
||||||
// let mut records = state.records.lock().await;
|
// let mut records = state.records.lock().await;
|
||||||
|
@ -18,5 +22,7 @@ pub fn spawn(_state: AppState) {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
.instrument(info_span!("sweeper")),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue