feat: updates
This commit is contained in:
@@ -245,7 +245,7 @@ fn process_config_item(options: &Options, config_item: &OSSBackupdConfigItem,
|
|||||||
if options.verbose {
|
if options.verbose {
|
||||||
debugging!("Upload file: {}", temp_encrypted_file);
|
debugging!("Upload file: {}", temp_encrypted_file);
|
||||||
}
|
}
|
||||||
if let Err(e) = oss_client.put_file(bucket, &temp_new_file, oss_util::DEFAULT_URL_VALID_IN_SECS, file_temp_encrypted_file) {
|
if let Err(e) = oss_client.put_file(bucket, &temp_new_file, DEFAULT_URL_VALID_IN_SECS, file_temp_encrypted_file) {
|
||||||
failure!("Error in encrypt file: {}, at item index: {}", e, item_index);
|
failure!("Error in encrypt file: {}, at item index: {}", e, item_index);
|
||||||
remove_temp_files();
|
remove_temp_files();
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ impl OSSClient {
|
|||||||
|
|
||||||
pub fn put_file(&self, bucket_name: &str, key: &str, expire_in_seconds: u64, file: File) -> XResult<Response> {
|
pub fn put_file(&self, bucket_name: &str, key: &str, expire_in_seconds: u64, file: File) -> XResult<Response> {
|
||||||
let client = Client::new();
|
let client = Client::new();
|
||||||
Ok(client.put(&self.generate_signed_put_url(bucket_name, key, expire_in_seconds)).body(file).send()?)
|
Ok(client.put(self.generate_signed_put_url(bucket_name, key, expire_in_seconds)).body(file).send()?)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn delete_file(&self, bucket_name: &str, key: &str) -> XResult<Response> {
|
pub fn delete_file(&self, bucket_name: &str, key: &str) -> XResult<Response> {
|
||||||
|
|||||||
Reference in New Issue
Block a user