From c35c36bf81cae52dacf8e3f8dc858bb376ca424b Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Tue, 21 Sep 2021 14:17:23 +0200 Subject: Wired up scrubbing to more higher level services Also moved sharding logic for filecas into a function to redduce cut/pasta --- zenserver/cache/structuredcache.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'zenserver/cache/structuredcache.cpp') diff --git a/zenserver/cache/structuredcache.cpp b/zenserver/cache/structuredcache.cpp index 7f1fe7b44..533fea498 100644 --- a/zenserver/cache/structuredcache.cpp +++ b/zenserver/cache/structuredcache.cpp @@ -176,7 +176,16 @@ HttpStructuredCacheService::Flush() void HttpStructuredCacheService::Scrub(ScrubContext& Ctx) { - ZEN_UNUSED(Ctx); + if (m_LastScrubTime == Ctx.ScrubTimestamp()) + { + return; + } + + m_LastScrubTime = Ctx.ScrubTimestamp(); + + m_CasStore.Scrub(Ctx); + m_CidStore.Scrub(Ctx); + m_CacheStore.Scrub(Ctx); } void -- cgit v1.2.3