From 157614349f5f4c2387e0a970a4ca3ddaeaa23446 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 7 May 2026 15:41:19 +0100 Subject: Handle completed curl operations in a job Removes the need to block the main thread from reading stdin while performing post curl operation actions, such as updating user agent details. --- src/ingestor.hpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ingestor.hpp') diff --git a/src/ingestor.hpp b/src/ingestor.hpp index a51c46c..1125692 100644 --- a/src/ingestor.hpp +++ b/src/ingestor.hpp @@ -75,6 +75,7 @@ namespace WebStat { std::expected parkLogLines(LineBatch &); void runJobsAsNeeded(); + Job::Result jobHandleCompleteCurlOps(); Job::Result jobReadParkedLines(); Job::Result jobPurgeOldLogs(); Job::Result jobStoreQueuedLines(); @@ -105,6 +106,7 @@ namespace WebStat { bool terminated = false; Job::LastRunTime lastCheckedJobs {Job::LastRunTime::clock::now()}; + Job handleCompleteCurlOps; Job ingestParkedLines; Job purgeOldLogs; Job storeQueueLines; @@ -115,6 +117,8 @@ namespace WebStat { void storeNewEntities(DB::Connection *, std::span) const; void storeNewEntity(DB::Connection *, Entity &) const; void onNewUserAgent(const Entity &) const; + auto withCurlLock(auto &&...); + bool haveCurlOperations(); void handleCurlOperations(); void logStats() const; void clearStats(); -- cgit v1.3