summaryrefslogtreecommitdiff
path: root/src/ingestor.hpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan.goodliffe@octal.co.uk>2026-05-07 15:41:19 +0100
committerDan Goodliffe <dan.goodliffe@octal.co.uk>2026-05-07 15:41:19 +0100
commit157614349f5f4c2387e0a970a4ca3ddaeaa23446 (patch)
tree4cd4dcd1a09638d692527d70c359e5c225745304 /src/ingestor.hpp
parentcbb2035fd33ba84fea56c7a7223c563b925e8649 (diff)
downloadwebstat-157614349f5f4c2387e0a970a4ca3ddaeaa23446.tar.bz2
webstat-157614349f5f4c2387e0a970a4ca3ddaeaa23446.tar.xz
webstat-157614349f5f4c2387e0a970a4ca3ddaeaa23446.zip
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.
Diffstat (limited to 'src/ingestor.hpp')
-rw-r--r--src/ingestor.hpp4
1 files changed, 4 insertions, 0 deletions
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<std::filesystem::path, int> 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<Entity *>) const;
void storeNewEntity(DB::Connection *, Entity &) const;
void onNewUserAgent(const Entity &) const;
+ auto withCurlLock(auto &&...);
+ bool haveCurlOperations();
void handleCurlOperations();
void logStats() const;
void clearStats();