aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/zenserver.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-08-26 11:43:37 +0200
committerGitHub Enterprise <[email protected]>2025-08-26 11:43:37 +0200
commitfb137cf9c8b7a9d1659b03472c9591c4863e9173 (patch)
treebbd0df09d4b425ef668d22f3b12ea2cb3482bf66 /src/zenserver/zenserver.cpp
parentMerge pull request #139 from ue-foundation/de/zen-service-command (diff)
downloadzen-fb137cf9c8b7a9d1659b03472c9591c4863e9173.tar.xz
zen-fb137cf9c8b7a9d1659b03472c9591c4863e9173.zip
revert multi-cid store (#475)
Diffstat (limited to 'src/zenserver/zenserver.cpp')
-rw-r--r--src/zenserver/zenserver.cpp38
1 files changed, 16 insertions, 22 deletions
diff --git a/src/zenserver/zenserver.cpp b/src/zenserver/zenserver.cpp
index 71b52817c..48a2dad95 100644
--- a/src/zenserver/zenserver.cpp
+++ b/src/zenserver/zenserver.cpp
@@ -242,18 +242,18 @@ ZenServer::Initialize(const ZenServerOptions& ServerOptions, ZenServerState::Zen
CidStoreConfiguration Config;
Config.RootDirectory = m_DataRoot / "cas";
- m_CidStores.insert_or_assign({}, std::make_unique<CidStore>(m_GcManager));
- m_CidStores.at({})->Initialize(Config);
+ m_CidStore = std::make_unique<CidStore>(m_GcManager);
+ m_CidStore->Initialize(Config);
ZEN_INFO("instantiating project service");
- m_ProjectStore = new ProjectStore([this](std::string_view) -> CidStore& { return *m_CidStores.at({}).get(); },
+ m_ProjectStore = new ProjectStore(*m_CidStore,
m_DataRoot / "projects",
m_GcManager,
*m_JobQueue,
*m_OpenProcessCache,
ProjectStore::Configuration{});
- m_HttpProjectService.reset(new HttpProjectService(m_ProjectStore, m_StatusService, m_StatsService, *m_AuthMgr));
+ m_HttpProjectService.reset(new HttpProjectService{*m_CidStore, m_ProjectStore, m_StatusService, m_StatsService, *m_AuthMgr});
if (ServerOptions.WorksSpacesConfig.Enabled)
{
@@ -600,7 +600,7 @@ ZenServer::InitializeStructuredCache(const ZenServerOptions& ServerOptions)
UpstreamOptions.ThreadCount = static_cast<uint32_t>(UpstreamConfig.UpstreamThreadCount);
}
- m_UpstreamCache = CreateUpstreamCache(UpstreamOptions, *m_CacheStore);
+ m_UpstreamCache = CreateUpstreamCache(UpstreamOptions, *m_CacheStore, *m_CidStore);
m_UpstreamService = std::make_unique<HttpUpstreamService>(*m_UpstreamCache, *m_AuthMgr);
m_UpstreamCache->Initialize();
@@ -664,23 +664,19 @@ ZenServer::InitializeStructuredCache(const ZenServerOptions& ServerOptions)
}
}
- m_StructuredCacheService = std::make_unique<HttpStructuredCacheService>(
- *m_CacheStore,
- [this](std::string_view) -> CidStore& { return *m_CidStores.at({}).get(); },
- m_StatsService,
- m_StatusService,
- *m_UpstreamCache,
- m_GcManager.GetDiskWriteBlocker(),
- *m_OpenProcessCache);
+ m_StructuredCacheService = std::make_unique<HttpStructuredCacheService>(*m_CacheStore,
+ *m_CidStore,
+ m_StatsService,
+ m_StatusService,
+ *m_UpstreamCache,
+ m_GcManager.GetDiskWriteBlocker(),
+ *m_OpenProcessCache);
m_Http->RegisterService(*m_StructuredCacheService);
m_Http->RegisterService(*m_UpstreamService);
m_StatsReporter.AddProvider(m_CacheStore.Get());
- for (const auto& It : m_CidStores)
- {
- m_StatsReporter.AddProvider(It.second.get());
- }
+ m_StatsReporter.AddProvider(m_CidStore.get());
m_StatsReporter.AddProvider(m_BuildCidStore.get());
}
@@ -865,7 +861,7 @@ ZenServer::Cleanup()
m_Workspaces.reset();
m_HttpProjectService.reset();
m_ProjectStore = {};
- m_CidStores.clear();
+ m_CidStore.reset();
m_AuthService.reset();
m_AuthMgr.reset();
m_Http = {};
@@ -1053,10 +1049,8 @@ ZenServer::Flush()
{
ZEN_TRACE_CPU("ZenServer::Flush");
- for (auto& It : m_CidStores)
- {
- It.second->Flush();
- }
+ if (m_CidStore)
+ m_CidStore->Flush();
if (m_StructuredCacheService)
m_StructuredCacheService->Flush();