Update dependencies, reduce timeouts

This commit is contained in:
asonix 2023-07-16 15:19:15 -05:00
parent 377b894460
commit 99cbe6337e
2 changed files with 19 additions and 14 deletions

11
Cargo.lock generated
View file

@ -758,7 +758,7 @@ dependencies = [
[[package]]
name = "multipart-client-stream"
version = "0.1.0"
source = "git+https://git.asonix.dog/asonix/multipart-client-stream#5bb45e9e82c457dba6a793f3fa0d692e14ab684c"
source = "git+https://git.asonix.dog/asonix/multipart-client-stream#b655ef851145ea120d637ff7bfb6a3e8964281c9"
dependencies = [
"bytes",
"futures-core",
@ -766,6 +766,7 @@ dependencies = [
"rand",
"tokio",
"tokio-util",
"tracing",
]
[[package]]
@ -881,18 +882,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
[[package]]
name = "proc-macro2"
version = "1.0.65"
version = "1.0.66"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92de25114670a878b1261c79c9f8f729fb97e95bac93f6312f583c60dd6a1dfe"
checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.30"
version = "1.0.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5907a1b7c277254a8b15170f6e7c97cfa60ee7872a3217663bb81151e48184bb"
checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0"
dependencies = [
"proc-macro2",
]

View file

@ -22,6 +22,7 @@ use tokio::{
},
task::JoinSet,
};
use tracing::Instrument;
use tracing_subscriber::{filter::Targets, layer::SubscriberExt, Layer, Registry};
use url::Url;
@ -132,7 +133,7 @@ impl State {
Ok(())
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip_all)]
async fn visit_dir(&self, path: &Path) -> color_eyre::Result<()> {
let mut read_dir = tokio::fs::read_dir(path).await?;
@ -158,12 +159,15 @@ impl State {
}
let this = self.clone();
set.spawn_local(async move {
let file_type = entry.file_type().await?;
let path = entry.path();
set.spawn_local(
async move {
let file_type = entry.file_type().await?;
let path = entry.path();
this.visit_path(&path, file_type).await
});
this.visit_path(&path, file_type).await
}
.instrument(tracing::info_span!("spawned")),
);
}
while let Some(res) = set.join_next().await {
@ -206,7 +210,7 @@ impl StateInner {
.client
.post(self.upload_endpoint())
.insert_header((CONTENT_TYPE, body.content_type()))
.timeout(Duration::from_secs(60))
.timeout(Duration::from_secs(20))
.send_stream(body)
.await;
@ -226,7 +230,7 @@ impl StateInner {
let mut uploads = match response {
UploadReponse::Error { msg } => {
tracing::warn!("Upload for {path:?} failed with message\n{msg}");
tracing::warn!("Upload failed with message\n{msg}");
return Ok(None);
}
UploadReponse::Ok { uploads, .. } => uploads,
@ -254,7 +258,7 @@ impl StateInner {
.client
.get(&claim_endpoint)
.query(upload)?
.timeout(Duration::from_secs(20))
.timeout(Duration::from_secs(15))
.send()
.await;