Skip to content

Commit a8f046a

Browse files
KixironJoshua Nelson
authored and
Joshua Nelson
committed
Made the S3 backend use S3_RUNTIME directly
1 parent 136b6f5 commit a8f046a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/storage/s3.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,13 @@ static S3_RUNTIME: Lazy<Mutex<Runtime>> =
2424
pub(crate) struct S3Backend {
2525
client: S3Client,
2626
bucket: String,
27-
runtime: &'static Mutex<Runtime>,
2827
}
2928

3029
impl S3Backend {
3130
pub(crate) fn new(client: S3Client, bucket: &str) -> Self {
3231
Self {
3332
client,
3433
bucket: bucket.into(),
35-
runtime: &*S3_RUNTIME,
3634
}
3735
}
3836

@@ -102,7 +100,7 @@ impl<'a> StorageTransaction for S3StorageTransaction<'a> {
102100
}
103101
attempts += 1;
104102

105-
match self.s3.runtime.lock().block_on(futures.map(drop).collect()) {
103+
match S3_RUNTIME.lock().block_on(futures.map(drop).collect()) {
106104
// this batch was successful, start another batch if there are still more files
107105
Ok(_) => break,
108106
Err(err) => {
@@ -114,6 +112,7 @@ impl<'a> StorageTransaction for S3StorageTransaction<'a> {
114112
}
115113
}
116114
}
115+
117116
Ok(())
118117
}
119118

0 commit comments

Comments
 (0)