Merge pull request 'dont clutter logs' (#385) from usage-stats into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 13m29s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 5m27s

Reviewed-on: #385
This commit is contained in:
philipp 2024-04-16 10:00:45 +02:00
commit 74f4d4854a

View File

@ -125,7 +125,7 @@ impl Fairing for Usage {
Ok(user_id) => {
let db = req.rocket().state::<SqlitePool>().unwrap();
if let Some(user) = User::find_by_id(db, user_id).await {
user.name
format!("User: {}", user.name)
} else {
format!("USER ID {user_id} NOT EXISTS")
}
@ -137,7 +137,11 @@ impl Fairing for Usage {
let uri = req.uri().to_string();
if !uri.ends_with(".css") && !uri.ends_with(".js") {
if !uri.ends_with(".css")
&& !uri.ends_with(".js")
&& !uri.ends_with(".ico")
&& !uri.ends_with(".json")
{
let config = req.rocket().state::<Config>().unwrap();
let Ok(mut file) = OpenOptions::new()
.write(true)