aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/zenserver.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-11-23 13:43:37 +0100
committerGitHub <[email protected]>2023-11-23 13:43:37 +0100
commit48f4a8bce0450263cda89d3b33fc15e32620e6f4 (patch)
treea4e28d9b3922f8934f1a01bd87b0674268620ba4 /src/zenserver/zenserver.cpp
parent0.2.36-pre1 (diff)
downloadzen-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.cpp8
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);