mirror of
https://github.com/flibusta-apps/batch_downloader.git
synced 2025-12-06 14:25:36 +01:00
Fix
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
use chrono::{DateTime, Duration, Utc};
|
||||
use minio_rsc::{client::ListObjectsArgs, datatype::Object};
|
||||
|
||||
use super::minio::get_minio;
|
||||
use super::minio::get_internal_minio;
|
||||
|
||||
pub async fn clean_files(bucket: String) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let minio_client = get_minio();
|
||||
let minio_client = get_internal_minio();
|
||||
|
||||
let objects = minio_client
|
||||
.list_objects(&bucket, ListObjectsArgs::default())
|
||||
|
||||
@@ -100,7 +100,6 @@ pub async fn upload_to_minio(
|
||||
let full_filename = format!("{}/{}", folder_name, filename);
|
||||
|
||||
let internal_minio = get_internal_minio();
|
||||
let minio = get_minio();
|
||||
|
||||
let is_bucket_exist = match internal_minio
|
||||
.bucket_exists(&config::CONFIG.minio_bucket)
|
||||
@@ -111,7 +110,9 @@ pub async fn upload_to_minio(
|
||||
};
|
||||
|
||||
if !is_bucket_exist {
|
||||
let _ = minio.make_bucket(&config::CONFIG.minio_bucket, false).await;
|
||||
let _ = internal_minio
|
||||
.make_bucket(&config::CONFIG.minio_bucket, false)
|
||||
.await;
|
||||
}
|
||||
|
||||
let data_stream = get_stream(Box::new(archive));
|
||||
@@ -128,6 +129,8 @@ pub async fn upload_to_minio(
|
||||
return Err(Box::new(err));
|
||||
}
|
||||
|
||||
let minio = get_minio();
|
||||
|
||||
let link = match minio
|
||||
.presigned_get_object(PresignedArgs::new(
|
||||
&config::CONFIG.minio_bucket,
|
||||
|
||||
Reference in New Issue
Block a user