lib.rs handled unwraps for errored deliveries

This commit is contained in:
2005 2024-10-25 23:38:19 +02:00
parent b0fc4e69e2
commit d0eba8fa34

View file

@ -241,11 +241,16 @@ impl BunBunWorker {
consumer
.for_each_concurrent(None, move |delivery| {
let handler = Arc::clone(&handler);
// TODO handle unwrap of delivery
let delivery = delivery.unwrap();
async move {
match delivery {
Err(error) => {
tracing::warn!("Received bad msg: {}", error);
}
Ok(delivery) => {
handler(delivery).await;
}
}
}
})
.await;
}));
@ -263,11 +268,16 @@ impl BunBunWorker {
consumer
.for_each_concurrent(None, move |delivery| {
let handler = Arc::clone(&handler);
// TODO handle unwrap of delivery
let delivery = delivery.unwrap();
async move {
match delivery {
Err(error) => {
tracing::warn!("Received bad msg: {}", error);
}
Ok(delivery) => {
handler(delivery).await;
}
}
}
})
.await;
}));