diff options
author | Florian Klink <flokli@flokli.de> | 2023-06-14T21·00+0300 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-06-14T23·16+0000 |
commit | c5851fb81548f4bf8b50bf489e85b52d19528c81 (patch) | |
tree | 06e36e8e972aec270b5a9dee9289b10783503684 /tvix | |
parent | 35bff2bda69d5189d9a439cd2032b86ebb4e6e41 (diff) |
refactor(tvix/store/blobsvc): make from_addr not async r/6305
A previous iteration of this code did actually connect (in the gRPC client), which was why we had this function async. However, as the connection there is now lazy too, we can drop the asyncness in this function. Change-Id: Idd5bd953a6a1c2334066ee672cfb87fcb74f9f94 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8780 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix')
-rw-r--r-- | tvix/store/src/bin/tvix-store.rs | 6 | ||||
-rw-r--r-- | tvix/store/src/blobservice/from_addr.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tvix/store/src/bin/tvix-store.rs b/tvix/store/src/bin/tvix-store.rs index 36969c1cd366..054b4f957206 100644 --- a/tvix/store/src/bin/tvix-store.rs +++ b/tvix/store/src/bin/tvix-store.rs @@ -128,7 +128,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { path_info_service_addr, } => { // initialize stores - let blob_service = blobservice::from_addr(&blob_service_addr).await?; + let blob_service = blobservice::from_addr(&blob_service_addr)?; let directory_service = directoryservice::from_addr(&directory_service_addr)?; let path_info_service = pathinfoservice::from_addr( &path_info_service_addr, @@ -173,7 +173,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { directory_service_addr, path_info_service_addr, } => { - let blob_service = blobservice::from_addr(&blob_service_addr).await?; + let blob_service = blobservice::from_addr(&blob_service_addr)?; let directory_service = directoryservice::from_addr(&directory_service_addr)?; let path_info_service = pathinfoservice::from_addr( &path_info_service_addr, @@ -211,7 +211,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { directory_service_addr, path_info_service_addr, } => { - let blob_service = blobservice::from_addr(&blob_service_addr).await?; + let blob_service = blobservice::from_addr(&blob_service_addr)?; let directory_service = directoryservice::from_addr(&directory_service_addr)?; let path_info_service = pathinfoservice::from_addr( &path_info_service_addr, diff --git a/tvix/store/src/blobservice/from_addr.rs b/tvix/store/src/blobservice/from_addr.rs index 761498041d9b..914e590033bb 100644 --- a/tvix/store/src/blobservice/from_addr.rs +++ b/tvix/store/src/blobservice/from_addr.rs @@ -11,7 +11,7 @@ use super::{BlobService, GRPCBlobService, MemoryBlobService, SledBlobService}; /// - `grpc+*://` ([GRPCBlobService]) /// /// See their [from_url] methods for more details about their syntax. -pub async fn from_addr(uri: &str) -> Result<Arc<dyn BlobService>, crate::Error> { +pub fn from_addr(uri: &str) -> Result<Arc<dyn BlobService>, crate::Error> { let url = Url::parse(uri).map_err(|e| { crate::Error::StorageError(format!("unable to parse url: {}", e.to_string())) })?; |