From 29f458117184af5b1507cac01b48b41bfbad568a Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 13 May 2026 15:49:10 +0100 Subject: Check terminated flag in jobPurgeOldLogs It's not critical to run to completion during shutdown, we can pick up where we left off on the next run. This will allow us to bail out instead of holding up the shutdown process. --- src/ingestor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/ingestor.cpp b/src/ingestor.cpp index e2c6f02..3e6e307 100644 --- a/src/ingestor.cpp +++ b/src/ingestor.cpp @@ -542,7 +542,7 @@ namespace WebStat { purge->bindParam(0, std::format("{} days", settings.purgeDaysToKeep)); purge->bindParam(1, settings.purgeDeleteMax); unsigned int purgedTotal {}; - while (stopAt > Job::LastRunTime::clock::now()) { + while (!terminated && stopAt > Job::LastRunTime::clock::now()) { const auto purged = purge->execute(); purgedTotal += purged; if (purged < settings.purgeDeleteMax) { -- cgit v1.3