summaryrefslogtreecommitdiff
path: root/src/ingestor.hpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan.goodliffe@octal.co.uk>2026-03-17 17:33:14 +0000
committerDan Goodliffe <dan.goodliffe@octal.co.uk>2026-03-17 17:33:14 +0000
commitae0ee6bbfb4dcd1f112876d0e7e5b3bcabdfb002 (patch)
tree406c7383b4b710547688e9f46e48ae9f491b5912 /src/ingestor.hpp
parentfc96582867acd2bcaef29feaae5c1193969d9a27 (diff)
downloadwebstat-ae0ee6bbfb4dcd1f112876d0e7e5b3bcabdfb002.tar.bz2
webstat-ae0ee6bbfb4dcd1f112876d0e7e5b3bcabdfb002.tar.xz
webstat-ae0ee6bbfb4dcd1f112876d0e7e5b3bcabdfb002.zip
Use std::future over std::thread for background jobsHEADmain
Easier checking if a job has completed [successfully] and reseting state for the next time.
Diffstat (limited to 'src/ingestor.hpp')
-rw-r--r--src/ingestor.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ingestor.hpp b/src/ingestor.hpp
index c5628d6..0bf2297 100644
--- a/src/ingestor.hpp
+++ b/src/ingestor.hpp
@@ -8,6 +8,7 @@
#include <connection_fwd.h>
#include <cstdio>
#include <flat_set>
+#include <future>
#include <scn/scan.h>
#include <span>
#include <sys/utsname.h>
@@ -78,7 +79,7 @@ namespace WebStat {
const Impl impl;
LastRunTime lastRun {LastRunTime::clock::now()};
- std::optional<std::thread> currentRun {std::nullopt};
+ std::optional<std::future<unsigned int>> currentRun;
};
Job::LastRunTime lastCheckedJobs {Job::LastRunTime::clock::now()};