fix: update log file handling to include timestamp in renamed log files

This commit is contained in:
2026-01-12 16:28:09 +01:00
parent 0685de8ffa
commit 9e567ae760
2 changed files with 5 additions and 2 deletions

View File

@@ -89,7 +89,9 @@ async fn catch_all(req: HttpRequest, _payload: Option<web::Json<Value>>) -> acti
#[actix_web::main]
async fn main() -> std::io::Result<()> {
let _ = fs::create_dir_all(LOG_DIR);
let _ = fs::remove_file(format!("{}{}", LOG_DIR, LOG_FILE_NAME));
let log_file_path = format!("{}{}", LOG_DIR, LOG_FILE_NAME);
let time_tag = chrono::Local::now().format("%Y_%m_%d");
let _ = fs::rename(log_file_path, format!("{}_{}", time_tag, &LOG_FILE_NAME));
let assets = data_mgt::AssetTracker::new();