diff options
Diffstat (limited to 'zenserver/zenserver.cpp')
| -rw-r--r-- | zenserver/zenserver.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp index f1db8676b..c55d3497e 100644 --- a/zenserver/zenserver.cpp +++ b/zenserver/zenserver.cpp @@ -59,7 +59,7 @@ class ZenServer { public: - void Initialize(int BasePort, int ParentPid) + void Initialize(ZenServiceConfig& ServiceConfig, int BasePort, int ParentPid) { using namespace fmt::literals; spdlog::info(ZEN_APP_NAME " initializing"); @@ -78,11 +78,6 @@ public: } } - // Prototype config system, let's see how this pans out - - ZenServiceConfig ServiceConfig; - ParseServiceConfig(m_DataRoot, /* out */ ServiceConfig); - // Ok so now we're configured, let's kick things off zen::CasStoreConfiguration Config; @@ -122,6 +117,11 @@ public: spdlog::info("NOT instantiating structured cache service"); } + if (ServiceConfig.MeshEnabled) + { + StartMesh(BasePort); + } + m_Http.Initialize(BasePort); m_Http.AddEndpoint(m_HealthService); m_Http.AddEndpoint(m_TestService); @@ -256,10 +256,15 @@ main(int argc, char* argv[]) mi_version(); ZenServerOptions GlobalOptions; - ParseGlobalCliOptions(argc, argv, GlobalOptions); + ZenServiceConfig ServiceConfig; + ParseGlobalCliOptions(argc, argv, GlobalOptions, ServiceConfig); InitializeCrashReporting(GlobalOptions.DataDir / "crashdumps"); InitializeLogging(GlobalOptions); + // Prototype config system, let's see how this pans out + + ParseServiceConfig(GlobalOptions.DataDir, /* out */ ServiceConfig); + spdlog::info("zen cache server starting on port {}", GlobalOptions.BasePort); try @@ -270,12 +275,7 @@ main(int argc, char* argv[]) ZenServer Server; Server.SetDataRoot(GlobalOptions.DataDir); Server.SetTestMode(GlobalOptions.IsTest); - Server.Initialize(GlobalOptions.BasePort, GlobalOptions.OwnerPid); - - if (GlobalOptions.EnableMesh) - { - Server.StartMesh(GlobalOptions.BasePort); - } + Server.Initialize(ServiceConfig, GlobalOptions.BasePort, GlobalOptions.OwnerPid); if (!GlobalOptions.ChildId.empty()) { |