aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/projectstore/projectstore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenserver/projectstore/projectstore.cpp')
-rw-r--r--src/zenserver/projectstore/projectstore.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/zenserver/projectstore/projectstore.cpp b/src/zenserver/projectstore/projectstore.cpp
index 21aa6b44a..200aba3a9 100644
--- a/src/zenserver/projectstore/projectstore.cpp
+++ b/src/zenserver/projectstore/projectstore.cpp
@@ -3184,6 +3184,8 @@ ProjectStore::RemoveExpiredData(GcCtx& Ctx, GcStats& Stats)
std::vector<Ref<Project>> ExpiredProjects;
std::vector<Ref<Project>> Projects;
+ DiscoverProjects();
+
{
RwLock::SharedLockScope Lock(m_ProjectsLock);
for (auto& Kv : m_Projects)
@@ -3197,13 +3199,30 @@ ProjectStore::RemoveExpiredData(GcCtx& Ctx, GcStats& Stats)
}
}
+ for (const Ref<Project>& Project : Projects)
+ {
+ std::vector<std::string> OpLogs = Project->ScanForOplogs();
+ for (const std::string& OpLogId : OpLogs)
+ {
+ Project->OpenOplog(OpLogId);
+ if (Ctx.IsCancelledFlag)
+ {
+ return nullptr;
+ }
+ }
+ }
+
size_t OplogCount = 0;
size_t ExpiredOplogCount = 0;
for (const Ref<Project>& Project : Projects)
{
+ if (Ctx.IsCancelledFlag)
+ {
+ break;
+ }
+
std::vector<std::string> ExpiredOplogs;
{
- RwLock::ExclusiveLockScope __(m_ProjectsLock);
Project->IterateOplogs(
[&Ctx, &Project, &ExpiredOplogs, &OplogCount](const RwLock::SharedLockScope& Lock, ProjectStore::Oplog& Oplog) {
OplogCount++;
@@ -3233,7 +3252,7 @@ ProjectStore::RemoveExpiredData(GcCtx& Ctx, GcStats& Stats)
Stats.CheckedCount += ProjectCount + OplogCount;
- if (ExpiredProjects.empty())
+ if (ExpiredProjects.empty() && ExpiredOplogCount == 0)
{
ZEN_DEBUG("GCV2: projectstore [REMOVE EXPIRED] '{}': no expired projects found", m_ProjectBasePath);
return nullptr;