Don't hang the overlord when processing incoming events

This commit is contained in:
Mike Dilger 2022-12-30 10:04:38 +13:00
parent 003cb3b3f8
commit 9105602016

View File

@ -471,9 +471,11 @@ impl Overlord {
self.post_reply(content, reply_to).await?; self.post_reply(content, reply_to).await?;
} }
"process_incoming_events" => { "process_incoming_events" => {
for (event, url) in GLOBALS.incoming_events.write().await.drain(..) { let _ = tokio::spawn(async move {
crate::process::process_new_event(&event, true, Some(url)).await?; for (event, url) in GLOBALS.incoming_events.write().await.drain(..) {
} let _ = crate::process::process_new_event(&event, true, Some(url)).await;
}
});
} }
_ => {} _ => {}
}, },