handlers-refactored
Some checks failed
deploy / deploy (push) Failing after 4m4s

This commit is contained in:
2024-10-22 00:36:42 +03:00
parent 4a1f985cce
commit 9fcce86075
9 changed files with 245 additions and 232 deletions

View File

@@ -29,9 +29,9 @@ pub async fn upload_to_s3(
pub async fn check_file_exists(
s3_client: &S3Client,
bucket: &str,
key: &str,
file_key: &str,
) -> Result<bool, actix_web::Error> {
match s3_client.head_object().bucket(bucket).key(key).send().await {
match s3_client.head_object().bucket(bucket).key(file_key).send().await {
Ok(_) => Ok(true), // Файл найден
Err(SdkError::ServiceError(service_error)) if service_error.err().is_not_found() => {
Ok(false) // Файл не найден