diff options
| author | Stefan Boberg <[email protected]> | 2023-11-23 13:43:37 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-11-23 13:43:37 +0100 |
| commit | 48f4a8bce0450263cda89d3b33fc15e32620e6f4 (patch) | |
| tree | a4e28d9b3922f8934f1a01bd87b0674268620ba4 /src/zenserver/zenserver.cpp | |
| parent | 0.2.36-pre1 (diff) | |
| download | zen-48f4a8bce0450263cda89d3b33fc15e32620e6f4.tar.xz zen-48f4a8bce0450263cda89d3b33fc15e32620e6f4.zip | |
added --powercycle option (#565)
* added --powercycle option. when this is passed in the zenserver process will shut down immediately after initialization is complete. This is primarily useful when benchmarking init/cleanup but could also be used to verify/clean up disk state
* moved EmptyStandbyList code to make it accessible to more commands
Diffstat (limited to 'src/zenserver/zenserver.cpp')
| -rw-r--r-- | src/zenserver/zenserver.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/zenserver/zenserver.cpp b/src/zenserver/zenserver.cpp index a50ff1b53..ba9ff4f88 100644 --- a/src/zenserver/zenserver.cpp +++ b/src/zenserver/zenserver.cpp @@ -117,6 +117,7 @@ ZenServer::Initialize(const ZenServerOptions& ServerOptions, ZenServerState::Zen m_UseSentry = ServerOptions.NoSentry == false; m_ServerEntry = ServerEntry; m_DebugOptionForcedCrash = ServerOptions.ShouldCrash; + m_IsPowerCycle = ServerOptions.IsPowerCycle; const int ParentPid = ServerOptions.OwnerPid; if (ParentPid) @@ -591,6 +592,13 @@ ZenServer::Run() OnReady(); + if (m_IsPowerCycle) + { + ZEN_INFO("Power cycle mode enabled -- shutting down"); + + RequestExit(0); + } + m_Http->Run(IsInteractiveMode); SetNewState(kShuttingDown); |