summaryrefslogtreecommitdiff
path: root/src/ingestor.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ingestor.hpp')
-rw-r--r--src/ingestor.hpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ingestor.hpp b/src/ingestor.hpp
index dd803ce..a51c46c 100644
--- a/src/ingestor.hpp
+++ b/src/ingestor.hpp
@@ -46,10 +46,12 @@ namespace WebStat {
using LastRunTime = std::chrono::system_clock::time_point;
using Result = std::function<unsigned int()>;
using Impl = Result (Ingestor::*)();
+ using Cond = bool (Ingestor::*)();
- explicit Job(Impl jobImpl) : impl(jobImpl) { }
+ explicit Job(Impl jobImpl, Cond jobCond = nullptr) : impl {jobImpl}, cond {jobCond} { }
const Impl impl;
+ const Cond cond;
LastRunTime lastRun {LastRunTime::clock::now()};
std::optional<std::future<Result>> currentRun;
};