Update server to spawn new task per request to ensure it doesn't block processing a request

pull/146/head
Chip Senkbeil 2 years ago
parent f3a1bdfd3d
commit e81edb75f6
No known key found for this signature in database
GPG Key ID: 35EF1F8EC72A4131

@ -284,7 +284,10 @@ where
local_data: Arc::clone(&local_data),
};
handler.on_request(ctx).await;
// Spawn a new task to run the request handler so we don't block
// our connection from processing other requests
let handler = Arc::clone(&handler);
tokio::spawn(async move { handler.on_request(ctx).await });
}
Err(x) => {
if log::log_enabled!(Level::Trace) {

Loading…
Cancel
Save