aboutsummaryrefslogtreecommitdiff
path: root/zenserver/cache/structuredcachestore.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-10-18 09:10:07 +0200
committerStefan Boberg <[email protected]>2021-10-18 09:10:07 +0200
commit94efab8e5c00f4b552946d8c1bdc69453020f888 (patch)
treedf312c80719590c847253e952ea27322187b2d88 /zenserver/cache/structuredcachestore.cpp
parentstructured cache: Implemented GarbageCollect() for disk and memory buckets (diff)
downloadzen-94efab8e5c00f4b552946d8c1bdc69453020f888.tar.xz
zen-94efab8e5c00f4b552946d8c1bdc69453020f888.zip
gc: moved GcContect from CAS into gc files
Diffstat (limited to 'zenserver/cache/structuredcachestore.cpp')
-rw-r--r--zenserver/cache/structuredcachestore.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp
index e7b840ed8..15f7b5a7a 100644
--- a/zenserver/cache/structuredcachestore.cpp
+++ b/zenserver/cache/structuredcachestore.cpp
@@ -15,6 +15,7 @@
#include <zenstore/basicfile.h>
#include <zenstore/cas.h>
#include <zenstore/caslog.h>
+#include <zenstore/gc.h>
#include <concepts>
#include <filesystem>
@@ -1050,7 +1051,12 @@ ZenCacheDiskLayer::Scrub(ScrubContext& Ctx)
void
ZenCacheDiskLayer::GarbageCollect(GcContext& GcCtx)
{
- ZEN_UNUSED(GcCtx);
+ RwLock::SharedLockScope _(m_Lock);
+
+ for (auto& Kv : m_Buckets)
+ {
+ Kv.second.GarbageCollect(GcCtx);
+ }
}
} // namespace zen