Sync handlers cannot be cancelled

This commit is contained in:
Lukas Wirth
2022-06-01 12:17:49 +02:00
parent e2da967578
commit d88ae66ed9
3 changed files with 9 additions and 19 deletions

View File

@@ -51,10 +51,9 @@ impl<'a> RequestDispatcher<'a> {
let _pctx = stdx::panic_context::enter(panic_context);
f(self.global_state, params)
};
match result_to_response::<R>(req.id.clone(), result) {
Ok(response) => self.global_state.respond(response),
Err(_) => self.global_state.task_pool.handle.send_retry(req),
};
if let Ok(response) = result_to_response::<R>(req.id.clone(), result) {
self.global_state.respond(response);
}
self
}
@@ -80,10 +79,9 @@ impl<'a> RequestDispatcher<'a> {
f(global_state_snapshot, params)
});
match thread_result_to_response::<R>(req.id.clone(), result) {
Ok(response) => self.global_state.respond(response),
Err(_) => self.global_state.task_pool.handle.send_retry(req),
};
if let Ok(response) = thread_result_to_response::<R>(req.id.clone(), result) {
self.global_state.respond(response);
}
self
}