lib.rs handled unwraps for errored deliveries
This commit is contained in:
parent
b0fc4e69e2
commit
d0eba8fa34
22
src/lib.rs
22
src/lib.rs
|
@ -241,10 +241,15 @@ impl BunBunWorker {
|
||||||
consumer
|
consumer
|
||||||
.for_each_concurrent(None, move |delivery| {
|
.for_each_concurrent(None, move |delivery| {
|
||||||
let handler = Arc::clone(&handler);
|
let handler = Arc::clone(&handler);
|
||||||
// TODO handle unwrap of delivery
|
|
||||||
let delivery = delivery.unwrap();
|
|
||||||
async move {
|
async move {
|
||||||
handler(delivery).await;
|
match delivery {
|
||||||
|
Err(error) => {
|
||||||
|
tracing::warn!("Received bad msg: {}", error);
|
||||||
|
}
|
||||||
|
Ok(delivery) => {
|
||||||
|
handler(delivery).await;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.await;
|
.await;
|
||||||
|
@ -263,10 +268,15 @@ impl BunBunWorker {
|
||||||
consumer
|
consumer
|
||||||
.for_each_concurrent(None, move |delivery| {
|
.for_each_concurrent(None, move |delivery| {
|
||||||
let handler = Arc::clone(&handler);
|
let handler = Arc::clone(&handler);
|
||||||
// TODO handle unwrap of delivery
|
|
||||||
let delivery = delivery.unwrap();
|
|
||||||
async move {
|
async move {
|
||||||
handler(delivery).await;
|
match delivery {
|
||||||
|
Err(error) => {
|
||||||
|
tracing::warn!("Received bad msg: {}", error);
|
||||||
|
}
|
||||||
|
Ok(delivery) => {
|
||||||
|
handler(delivery).await;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.await;
|
.await;
|
||||||
|
|
Loading…
Reference in a new issue