From cbb2035fd33ba84fea56c7a7223c563b925e8649 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 7 May 2026 15:40:11 +0100 Subject: Add support for conditional job execution Performs a check before launching a job thread, rather than just having it exit immediately. --- src/ingestor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/ingestor.cpp') diff --git a/src/ingestor.cpp b/src/ingestor.cpp index fe8d38c..5f9fa60 100644 --- a/src/ingestor.cpp +++ b/src/ingestor.cpp @@ -426,7 +426,9 @@ namespace WebStat { } } else if (expired(job.lastRun, freq, now)) { - job.currentRun.emplace(std::async(job.impl, this)); + if (!job.cond || std::invoke(job.cond, this)) { + job.currentRun.emplace(std::async(job.impl, this)); + } } }; runJobAsNeeded(ingestParkedLines, settings.freqIngestParkedLines); -- cgit v1.3