From 9601cfa98038bcb5c366a5b23f3725f59335d434 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sun, 26 May 2024 15:45:40 +0200 Subject: [PATCH] feat: use new tokio stream Signed-off-by: kjuulh --- Cargo.lock | 39 ++----------------- crates/flux-releaser/Cargo.toml | 9 ++++- .../src/services/flux_releaser_uploader.rs | 3 +- 3 files changed, 12 insertions(+), 39 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ed29b0f..c2bb4d2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -122,22 +122,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ "concurrent-queue", - "event-listener-strategy 0.5.2", + "event-listener-strategy", "futures-core", "pin-project-lite", ] -[[package]] -name = "async-lock" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" -dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy 0.4.0", - "pin-project-lite", -] - [[package]] name = "async-stream" version = "0.3.5" @@ -762,12 +751,11 @@ dependencies = [ [[package]] name = "blocking" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "495f7104e962b7356f0aeb34247aca1fe7d2e783b346582db7f2904cb5717e88" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ "async-channel", - "async-lock", "async-task", "futures-io", "futures-lite", @@ -1201,17 +1189,6 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" -[[package]] -name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - [[package]] name = "event-listener" version = "5.3.0" @@ -1223,16 +1200,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.3", - "pin-project-lite", -] - [[package]] name = "event-listener-strategy" version = "0.5.2" diff --git a/crates/flux-releaser/Cargo.toml b/crates/flux-releaser/Cargo.toml index daeaa7d..4b2c80e 100644 --- a/crates/flux-releaser/Cargo.toml +++ b/crates/flux-releaser/Cargo.toml @@ -22,9 +22,14 @@ serde_json = "1.0.113" nats = "0.24.1" walkdir = "2.4.0" tar = "0.4.40" -tokio-stream = { version = "0.1.14", features = ["full"] } +tokio-stream = { version = "0.1.15", features = ["full"] } rand = "0.8.5" -sqlx = { version = "0.7.3", features = ["postgres", "runtime-tokio", "uuid", "chrono"] } +sqlx = { version = "0.7.3", features = [ + "postgres", + "runtime-tokio", + "uuid", + "chrono", +] } chrono = "0.4.34" git2 = "0.18.3" diff --git a/crates/flux-releaser/src/services/flux_releaser_uploader.rs b/crates/flux-releaser/src/services/flux_releaser_uploader.rs index e7b8a64..728e8d2 100644 --- a/crates/flux-releaser/src/services/flux_releaser_uploader.rs +++ b/crates/flux-releaser/src/services/flux_releaser_uploader.rs @@ -25,11 +25,12 @@ impl FluxReleaserUploader { }) .collect::>(); + let iter = tokio_stream::iter(chunks); let resp = self .flux_client .lock() .await - .upload_artifact(tonic::Request::new(tokio_stream::iter(chunks))) + .upload_artifact(tonic::Request::new(iter)) .await?; resp.into_inner().upload_id.try_into()