diff --git a/services/backup/blob_client/src/get_client.rs b/services/backup/blob_client/src/get_client.rs --- a/services/backup/blob_client/src/get_client.rs +++ b/services/backup/blob_client/src/get_client.rs @@ -11,7 +11,7 @@ use libc; use libc::c_char; use std::ffi::CStr; -use std::sync::{Arc, Mutex}; +use std::sync::Mutex; use tokio::runtime::Runtime; use tokio::sync::mpsc; use tokio::task::JoinHandle; @@ -22,11 +22,11 @@ } lazy_static! { - static ref CLIENT: Arc>> = - Arc::new(Mutex::new(None)); + static ref CLIENT: Mutex> = + Mutex::new(None); static ref RUNTIME: Runtime = Runtime::new().unwrap(); - static ref ERROR_MESSAGES: Arc>> = - Arc::new(Mutex::new(Vec::new())); + static ref ERROR_MESSAGES: Mutex> = + Mutex::new(Vec::new()); } fn is_initialized() -> bool { diff --git a/services/backup/blob_client/src/put_client.rs b/services/backup/blob_client/src/put_client.rs --- a/services/backup/blob_client/src/put_client.rs +++ b/services/backup/blob_client/src/put_client.rs @@ -13,7 +13,7 @@ use libc; use libc::c_char; use std::ffi::CStr; -use std::sync::{Arc, Mutex}; +use std::sync::Mutex; use tokio::runtime::Runtime; use tokio::sync::mpsc; use tokio::task::JoinHandle; @@ -32,12 +32,12 @@ } lazy_static! { - static ref CLIENT: Arc>> = - Arc::new(Mutex::new(None)); + static ref CLIENT: Mutex> = + Mutex::new(None); // todo we should probably create separate clients for different IDs static ref RUNTIME: Runtime = Runtime::new().unwrap(); - static ref ERROR_MESSAGES: Arc>> = - Arc::new(Mutex::new(Vec::new())); + static ref ERROR_MESSAGES: Mutex> = + Mutex::new(Vec::new()); } fn is_initialized() -> bool { diff --git a/services/backup/blob_client/src/tools.rs b/services/backup/blob_client/src/tools.rs --- a/services/backup/blob_client/src/tools.rs +++ b/services/backup/blob_client/src/tools.rs @@ -1,10 +1,10 @@ use libc::c_char; use std::ffi::{CStr, CString}; -use std::sync::{Arc, Mutex}; +use std::sync::Mutex; use tracing::error; pub fn report_error( - error_messages: &Arc>>, + error_messages: &Mutex>, message: &str, label_provided: Option<&str>, ) { @@ -20,7 +20,7 @@ } pub fn check_error( - error_messages: &Arc>>, + error_messages: &Mutex>, ) -> Result<(), String> { if let Ok(errors) = error_messages.lock() { return match errors.is_empty() {