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,12 +121,19 @@ namespace crow
|
||||
timer.async_wait(handler);
|
||||
|
||||
init_count ++;
|
||||
try
|
||||
while(1)
|
||||
{
|
||||
io_service_pool_[i]->run();
|
||||
} catch(std::exception& e)
|
||||
{
|
||||
CROW_LOG_ERROR << "Worker Crash: An uncaught exception occurred: " << e.what();
|
||||
try
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user