Stop the service if the user quits via the tray icon

This commit is contained in:
Cameron Gutman 2023-04-15 17:51:32 -05:00
commit f51876893e
5 changed files with 56 additions and 13 deletions

View file

@ -727,9 +727,10 @@ namespace platf {
bool
restart() {
// Raise SIGINT to trigger the graceful exit logic. The service will
// restart us in a few seconds.
std::raise(SIGINT);
// Gracefully exit. The service will restart us in a few seconds.
// We use an async exit call here because we can't block the
// HTTP thread or we'll hang shutdown.
lifetime::exit_sunshine(0, true);
return true;
}