mirror of
https://github.com/CrowCpp/Crow.git
synced 2024-06-07 21:10:44 +00:00
Fix #245. Trying to keep serving after an exception in the handler.
This commit is contained in:
parent
2564c62778
commit
69a17f066b
@ -121,13 +121,20 @@ namespace crow
|
||||
timer.async_wait(handler);
|
||||
|
||||
init_count ++;
|
||||
while(1)
|
||||
{
|
||||
try
|
||||
{
|
||||
io_service_pool_[i]->run();
|
||||
if (io_service_pool_[i]->run() == 0)
|
||||
{
|
||||
// when io_service.run returns 0, there are no more works to do.
|
||||
break;
|
||||
}
|
||||
} catch(std::exception& e)
|
||||
{
|
||||
CROW_LOG_ERROR << "Worker Crash: An uncaught exception occurred: " << e.what();
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
if (tick_function_ && tick_interval_.count() > 0)
|
||||
|
Loading…
Reference in New Issue
Block a user