logdebug,more
All checks were successful
deploy / deploy (push) Successful in 1m3s

This commit is contained in:
Untone 2024-10-22 14:34:29 +03:00
parent 705f4c55d0
commit 97911e034a
2 changed files with 3 additions and 1 deletions

View File

@ -96,11 +96,13 @@ impl AppState {
let filelist = get_s3_filelist(&self.storj_client, &self.storj_bucket).await;
for [filename, filepath] in filelist.clone() {
if !filepath.starts_with("/development") {
// Сохраняем список файлов в Redis, используя HSET для каждого файла
let _: () = redis
.hset(PATH_MAPPING_KEY, filename.clone(), filepath)
.await
.expect(&format!("Failed to cache file {} in Redis", filename));
}
}
info!("cached {} files", filelist.len());

View File

@ -13,7 +13,7 @@ pub async fn serve_file(filepath: &str, state: &AppState) -> Result<HttpResponse
// Проверяем наличие файла в Storj S3
let exists = check_file_exists(&state.storj_client, &state.storj_bucket, &filepath).await?;
if !exists {
return Err(ErrorInternalServerError("File not found in Storj".to_string()));
return Err(ErrorInternalServerError(format!("File {} not found in Storj", filepath)));
}
// Получаем объект из Storj S3