diff options
Diffstat (limited to 'src/zenserver/hub/hub.cpp')
| -rw-r--r-- | src/zenserver/hub/hub.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
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<StorageServerInstance>( 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()) |