mirror of
https://github.com/flibusta-apps/telegram_files_server.git
synced 2025-12-06 20:45:37 +01:00
Add logs
This commit is contained in:
@@ -136,7 +136,10 @@ pub async fn clean_files() -> Result<(), Box<dyn Error>> {
|
||||
let metadata = file.metadata().await.unwrap();
|
||||
|
||||
if metadata.created()?.elapsed().unwrap().as_secs() > 3600 {
|
||||
let _ = tokio::fs::remove_file(file.path()).await;
|
||||
match tokio::fs::remove_file(file.path()).await {
|
||||
Ok(_) => log::info!("File {:?} removed", file.path()),
|
||||
Err(err) => log::error!("Error: {}", err),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user