Add an Apply button to the Web UI when running as a Win32 Service (#700)

This commit is contained in:
Cameron Gutman
2023-01-05 13:26:54 -06:00
committed by GitHub
parent 5980e520b9
commit 65574a02d4
7 changed files with 153 additions and 10 deletions

View File

@@ -1,3 +1,4 @@
#include <csignal>
#include <filesystem>
#include <iomanip>
#include <sstream>
@@ -522,4 +523,16 @@ void streaming_will_stop() {
DwmEnableMMCSS(false);
}
bool restart_supported() {
// Restart is supported if we're running from the service
return (GetConsoleWindow() == NULL);
}
bool restart() {
// Raise SIGINT to trigger the graceful exit logic. The service will
// restart us in a few seconds.
std::raise(SIGINT);
return true;
}
} // namespace platf