aboutsummaryrefslogtreecommitdiff
path: root/zenserver/cache/structuredcache.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-10-11 13:18:37 +0200
committerStefan Boberg <[email protected]>2021-10-11 13:18:37 +0200
commit37bf16575d226e6b53579eb913f70f869d3c3ec4 (patch)
treea677062fe7a0c4c318b7a36cb94a18fd203996dc /zenserver/cache/structuredcache.cpp
parentAdded lofreq timer update to httpsys main loop (diff)
downloadzen-37bf16575d226e6b53579eb913f70f869d3c3ec4.tar.xz
zen-37bf16575d226e6b53579eb913f70f869d3c3ec4.zip
stats: Added support for handler unregistration
Diffstat (limited to 'zenserver/cache/structuredcache.cpp')
-rw-r--r--zenserver/cache/structuredcache.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/zenserver/cache/structuredcache.cpp b/zenserver/cache/structuredcache.cpp
index 4a2a3748a..5166bee42 100644
--- a/zenserver/cache/structuredcache.cpp
+++ b/zenserver/cache/structuredcache.cpp
@@ -161,13 +161,16 @@ HttpStructuredCacheService::HttpStructuredCacheService(ZenCacheStore& InCac
, m_CidStore(InCidStore)
, m_UpstreamCache(std::move(UpstreamCache))
{
- StatsService.RegisterHandler("z$", *this);
- StatusService.RegisterHandler("z$", *this);
+ m_StatsService.RegisterHandler("z$", *this);
+ m_StatusService.RegisterHandler("z$", *this);
}
HttpStructuredCacheService::~HttpStructuredCacheService()
{
ZEN_INFO("closing structured cache");
+
+ m_StatsService.UnregisterHandler("z$", *this);
+ m_StatusService.UnregisterHandler("z$", *this);
}
const char*
@@ -275,6 +278,7 @@ HttpStructuredCacheService::HandleCacheRecordRequest(HttpServerRequest& Request,
HandleGetCacheRecord(Request, Ref, Policy);
}
break;
+
case kPut:
HandlePutCacheRecord(Request, Ref, Policy);
break;