in src/controller/controller.cpp [116:164]
int Controller::run()
{
try
{
Running running{*this};
while(true)
{
try
{
status.wait_and_rethrow_exception();
}
catch(SignalHandler::Signal& s)
{
if(s.signal_number == SIGHUP)
{
glog.reopen();
}
else if(s.signal_number == SIGWINCH)
{
analysis->on_unix_signal(s.signal_number);
}
else if(s.signal_number == SIGINT)
{
throw ProcessingDone{std::string{"Interrupted by user."}};
}
else if(s.signal_number == SIGTERM)
{
throw ProcessingDone{std::string{"Interrupted by SIGTERM."}};
}
else
{
throw ProcessingDone{std::string{"Unhandled signal presents: "} + s.what()};
}
}
}
}
catch(ProcessingDone& e)
{
if(utils::Out message{})
{
message << e.what();
}
}
if(utils::Log message{})
{
status.print(message);
}
return 0;
}