Skip to content

Commit

Permalink
πŸ’š fix upgrade to opendal 0.46
Browse files Browse the repository at this point in the history
  • Loading branch information
davidB committed May 24, 2024
1 parent 90e54c1 commit 639496c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 8 additions & 2 deletions cdviz-collector/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ publish = false
[dependencies]
axum = { version = "0.7", optional = true }
axum-tracing-opentelemetry = { version = "0.18", optional = true }
bytes = { version = "1.6", optional = true }
cdevents-sdk = { git = "https://github.com/cdevents/sdk-rust" }
chrono = "0.4"
clap = { version = "4", features = ["derive", "env"] }
Expand Down Expand Up @@ -64,10 +65,15 @@ rustainers = "0.12"
tracing-subscriber = "0.3"

[features]
default = ["source_http", "source_opendal", "sink_db", "reqwest/rustls"]
default = [
"source_http",
"source_opendal",
"sink_db",
"reqwest/rustls",
] #reqwest is also used as transitive dependencies
sink_db = ["dep:sqlx"]
source_http = ["dep:axum", "dep:axum-tracing-opentelemetry"]
source_opendal = ["dep:opendal", "dep:globset"]
source_opendal = ["dep:opendal", "dep:globset", "dep:bytes"]

[package.metadata.release]
pre-release-commit-message = "πŸš€ (cargo-release) version {{version}}"
Expand Down
5 changes: 3 additions & 2 deletions cdviz-collector/src/sources/opendal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ pub(crate) async fn run_once(
}

async fn process_entry(tx: &Sender<Message>, op: &Operator, entry: &Entry) -> Result<usize> {
let read = op.read(entry.path()).await?;
let cdevent: CDEvent = serde_json::from_slice::<CDEvent>(&read)?;
use bytes::Buf;
let buf = op.read(entry.path()).await?;
let cdevent: CDEvent = serde_json::from_reader(buf.reader())?;
tx.send(cdevent.into()).map_err(Error::from)
}

0 comments on commit 639496c

Please sign in to comment.