From 1d59440c6346204bf70550b05c165de361ef81d2 Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Thu, 19 Mar 2026 09:31:01 +0100 Subject: add --hub-hydration-target-spec to zen hub --- src/zenserver/hub/hub.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'src/zenserver/hub/hub.cpp') diff --git a/src/zenserver/hub/hub.cpp b/src/zenserver/hub/hub.cpp index 2f3873884..c35fa61e8 100644 --- a/src/zenserver/hub/hub.cpp +++ b/src/zenserver/hub/hub.cpp @@ -134,8 +134,16 @@ Hub::Hub(const Configuration& Config, m_ResourceLimits.DiskUsageBytes = 1000ull * 1024 * 1024 * 1024; m_ResourceLimits.MemoryUsageBytes = 16ull * 1024 * 1024 * 1024; - m_FileHydrationPath = m_RunEnvironment.CreateChildDir("hydration_storage"); - ZEN_INFO("using file hydration path: '{}'", m_FileHydrationPath); + if (m_Config.HydrationTargetSpecification.empty()) + { + std::filesystem::path FileHydrationPath = m_RunEnvironment.CreateChildDir("hydration_storage"); + ZEN_INFO("using file hydration path: '{}'", FileHydrationPath); + m_HydrationTargetSpecification = fmt::format("file://{}", WideToUtf8(FileHydrationPath.native())); + } + else + { + m_HydrationTargetSpecification = m_Config.HydrationTargetSpecification; + } m_HydrationTempPath = m_RunEnvironment.CreateChildDir("hydration_temp"); ZEN_INFO("using hydration temp path: '{}'", m_HydrationTempPath); @@ -226,15 +234,16 @@ Hub::Provision(std::string_view ModuleId, HubProvisionedInstanceInfo& OutInfo, s AllocatedPort = m_FreePorts.front(); m_FreePorts.pop_front(); - IsNewInstance = true; + IsNewInstance = true; + auto NewInstance = std::make_unique( m_RunEnvironment, - StorageServerInstance::Configuration{.BasePort = AllocatedPort, - .HydrationTempPath = m_HydrationTempPath, - .FileHydrationPath = m_FileHydrationPath, - .HttpThreadCount = m_Config.InstanceHttpThreadCount, - .CoreLimit = m_Config.InstanceCoreLimit, - .ConfigPath = m_Config.InstanceConfigPath}, + StorageServerInstance::Configuration{.BasePort = AllocatedPort, + .HydrationTempPath = m_HydrationTempPath, + .HydrationTargetSpecification = m_HydrationTargetSpecification, + .HttpThreadCount = m_Config.InstanceHttpThreadCount, + .CoreLimit = m_Config.InstanceCoreLimit, + .ConfigPath = m_Config.InstanceConfigPath}, ModuleId); #if ZEN_PLATFORM_WINDOWS if (m_JobObject.IsValid()) -- cgit v1.2.3