Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32542273
D5015.1767171882.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1023 B
Referenced Files
None
Subscribers
None
D5015.1767171882.diff
View Options
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
@@ -122,7 +122,24 @@
}
pub fn get_client_blocking_read_cxx() -> Result<Vec<u8>, String> {
- unimplemented!();
+ check_error()?;
+ let response: Option<Vec<u8>> = RUNTIME.block_on(async {
+ if let Ok(mut maybe_client) = CLIENT.lock() {
+ if let Some(mut client) = (*maybe_client).take() {
+ let maybe_data = client.rx.recv().await;
+ let response = Some(maybe_data.unwrap_or_else(|| vec![]));
+ *maybe_client = Some(client);
+ return response;
+ } else {
+ report_error("no client present".to_string());
+ }
+ } else {
+ report_error("couldn't access client".to_string());
+ }
+ None
+ });
+ check_error()?;
+ response.ok_or("response could not be obtained".to_string())
}
pub fn get_client_terminate_cxx() -> Result<(), String> {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 31, 9:04 AM (46 m, 9 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5871790
Default Alt Text
D5015.1767171882.diff (1023 B)
Attached To
Mode
D5015: [services] Backup - Blob Get Client - Add blocking read
Attached
Detach File
Event Timeline
Log In to Comment