Skip to content

Commit

Permalink
take an arc runtime (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
chebbyChefNEQ committed Aug 3, 2023
1 parent df10148 commit c0011ca
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ pub fn new_object_store_directory(
read_version: Option<u64>,
write_version: u64,
cache_loc: Option<&str>,
rt: Option<tokio::runtime::Runtime>,
rt: Option<Arc<tokio::runtime::Runtime>>,
) -> Result<Box<dyn Directory>, std::io::Error> {
if let Some(read_version) = read_version {
if read_version > write_version {
Expand All @@ -471,13 +471,12 @@ pub fn new_object_store_directory(
write_version,
local_fs: Arc::new(LocalFileSystem::new()),
cache_loc,
rt: Arc::new(
rt.unwrap_or(
tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()?,
),
),
rt: rt.unwrap_or(Arc::new(
tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()?,
)),

atomic_rw_lock: Arc::new(Mutex::new(())),
}))
}
Expand Down

0 comments on commit c0011ca

Please sign in to comment.