Skip to content

Commit 5acd658

Browse files
KixironJoshua Nelson
authored and
Joshua Nelson
committed
Moved unload increment
1 parent f2b9621 commit 5acd658

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/storage/s3.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use super::Blob;
22
use failure::Error;
33
use futures_util::{
4-
future::{FutureExt, TryFutureExt},
4+
future::FutureExt,
55
stream::{FuturesUnordered, StreamExt},
66
};
77
use log::{error, warn};
@@ -94,15 +94,16 @@ impl<'a> S3Backend<'a> {
9494
// emit an error and replace the error values with the blob that failed
9595
// to upload so that we can retry failed uploads
9696
.map(|resp| match resp {
97-
Ok(..) => Ok(()),
97+
Ok(..) => {
98+
// Increment the total uploaded files when a file is uploaded
99+
crate::web::metrics::UPLOADED_FILES_TOTAL.inc_by(1);
100+
101+
Ok(())
102+
}
98103
Err(err) => {
99104
error!("failed to upload file to s3: {:?}", err);
100105
Err(blob)
101106
}
102-
})
103-
.inspect_ok(|_| {
104-
// Increment the total uploaded files when a file is uploaded
105-
crate::web::metrics::UPLOADED_FILES_TOTAL.inc_by(1);
106107
}),
107108
);
108109
}

0 commit comments

Comments
 (0)