From caf171abc24c20206eb8ecaff4b6e9137cb9e871 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Wed, 13 Sep 2023 12:03:27 +0200 Subject: ZenCacheStore is now reference counted (#398) this change also adds a GetNamespaces function which may be used to enumerate all currently known cache namespaces --- src/zenserver/zenserver.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/zenserver/zenserver.cpp') diff --git a/src/zenserver/zenserver.cpp b/src/zenserver/zenserver.cpp index b8831476d..cfc4a228b 100644 --- a/src/zenserver/zenserver.cpp +++ b/src/zenserver/zenserver.cpp @@ -722,7 +722,7 @@ private: zen::GcManager m_GcManager; zen::GcScheduler m_GcScheduler{m_GcManager}; std::unique_ptr m_CidStore; - std::unique_ptr m_CacheStore; + Ref m_CacheStore; zen::HttpTestService m_TestService; #if ZEN_WITH_TESTS zen::HttpTestingService m_TestingService; @@ -870,12 +870,11 @@ ZenServer::InitializeStructuredCache(const ZenServerOptions& ServerOptions) using namespace std::literals; ZEN_INFO("instantiating structured cache service"); - m_CacheStore = - std::make_unique(m_GcManager, - ZenCacheStore::Configuration{.BasePath = m_DataRoot / "cache", - .AllowAutomaticCreationOfNamespaces = true, - .EnableWriteLog = ServerOptions.StructuredCacheWriteLogEnabled, - .EnableAccessLog = ServerOptions.StructuredCacheAccessLogEnabled}); + m_CacheStore = new ZenCacheStore(m_GcManager, + ZenCacheStore::Configuration{.BasePath = m_DataRoot / "cache", + .AllowAutomaticCreationOfNamespaces = true, + .EnableWriteLog = ServerOptions.StructuredCacheWriteLogEnabled, + .EnableAccessLog = ServerOptions.StructuredCacheAccessLogEnabled}); const ZenUpstreamCacheConfig& UpstreamConfig = ServerOptions.UpstreamCacheConfig; -- cgit v1.2.3