fix ci
Some checks failed
CI/CD Pipeline / test (push) Has been cancelled
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / deploy-main (push) Has been cancelled

This commit is contained in:
philipp 2024-04-16 09:06:24 +02:00
parent a9f74fcd3c
commit 8771a378da

View File

@ -139,11 +139,17 @@ impl Fairing for Usage {
if !uri.ends_with(".css") && !uri.ends_with(".js") {
let config = req.rocket().state::<Config>().unwrap();
let mut file = OpenOptions::new()
let Ok(mut file) = OpenOptions::new()
.write(true)
.append(true)
.open(config.usage_log_path.clone())
.unwrap();
else {
eprintln!(
"File {} can't be found, not saving usage logs",
config.usage_log_path.clone()
);
return;
};
if let Err(e) = writeln!(file, "{timestamp};{user};{uri}") {
eprintln!("Couldn't write to file: {}", e);