udpate actor error improvements

This commit is contained in:
Marin Postma 2021-05-25 09:46:11 +02:00
parent 4acbe8e473
commit 464639aa0f
No known key found for this signature in database
GPG key ID: D5241F0C0C865F30
3 changed files with 58 additions and 67 deletions

View file

@ -158,13 +158,7 @@ impl IndexController {
// prevent dead_locking between the update_handle::update that waits for the update to be
// registered and the update_actor that waits for the the payload to be sent to it.
tokio::task::spawn_local(async move {
payload
.map(|bytes| {
bytes.map_err(|e| {
Box::new(e) as Box<dyn std::error::Error + Sync + Send + 'static>
})
})
.for_each(|r| async {
payload.for_each(|r| async {
let _ = sender.send(r).await;
})
.await