notfound-fix2
All checks were successful
deploy / deploy (push) Successful in 1m5s

This commit is contained in:
Untone 2024-10-02 19:41:36 +03:00
parent 5b33e4a566
commit bcd66e798a

View File

@ -129,11 +129,15 @@ pub async fn proxy_handler(
// весь запрошенный путь
let requested_path = match state.get_path(&path).await {
Some(Some(path)) => path,
_ => {
Ok(Some(path)) => path,
Ok(None) => {
warn!("Путь не найден: {}", path);
return Ok(HttpResponse::NotFound().finish());
}
Err(e) => {
warn!("Ошибка: {}", e);
return Ok(HttpResponse::InternalServerError().finish());
}
};
info!("Запрошенный путь: {}", requested_path);
@ -157,7 +161,7 @@ pub async fn proxy_handler(
// Находим ближайший подходящий размер
let closest_width = find_closest_width(requested_width);
let thumbnail_key = format!("{}_{}", base_filename, closest_width);
info!("Ближайшая ширина: {}, Ключ миниатюры: {}", closest_width, thumbnail_key);
info!("Ближайшая ширина: {}, Кюч миниатюры: {}", closest_width, thumbnail_key);
// Проверяем наличие миниатюры в кэше
let cached_files = state.get_cached_file_list().await;