Page MenuHomePhabricator

D5114.diff
No OneTemporary

D5114.diff

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<Mutex<Option<ReadClient>>> =
- Arc::new(Mutex::new(None));
+ static ref CLIENT: Mutex<Option<ReadClient>> =
+ Mutex::new(None);
static ref RUNTIME: Runtime = Runtime::new().unwrap();
- static ref ERROR_MESSAGES: Arc<Mutex<Vec<String>>> =
- Arc::new(Mutex::new(Vec::new()));
+ static ref ERROR_MESSAGES: Mutex<Vec<String>> =
+ 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<Mutex<Option<BidiClient>>> =
- Arc::new(Mutex::new(None));
+ static ref CLIENT: Mutex<Option<BidiClient>> =
+ 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<Mutex<Vec<String>>> =
- Arc::new(Mutex::new(Vec::new()));
+ static ref ERROR_MESSAGES: Mutex<Vec<String>> =
+ 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<Mutex<Vec<String>>>,
+ error_messages: &Mutex<Vec<String>>,
message: &str,
label_provided: Option<&str>,
) {
@@ -20,7 +20,7 @@
}
pub fn check_error(
- error_messages: &Arc<Mutex<Vec<String>>>,
+ error_messages: &Mutex<Vec<String>>,
) -> Result<(), String> {
if let Ok(errors) = error_messages.lock() {
return match errors.is_empty() {

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 28, 8:32 AM (6 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2725009
Default Alt Text
D5114.diff (2 KB)

Event Timeline