From 4a640858b83120bee217d91339f7bc39175989c1 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 20 Dec 2025 15:12:53 +0000 Subject: Add support for configuring frequency of parked line job --- src/webstat_logger_main.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/webstat_logger_main.cpp b/src/webstat_logger_main.cpp index 625afc6..c859abf 100644 --- a/src/webstat_logger_main.cpp +++ b/src/webstat_logger_main.cpp @@ -1,4 +1,5 @@ #include "ingestor.hpp" +#include "util.hpp" #include #include #include @@ -18,6 +19,20 @@ namespace { } } +#define LEXICAL_CAST_DURATION(UNIT) \ + template<> std::chrono::UNIT boost::lexical_cast(const std::string & input) \ + { \ + return WebStat::parseDuration(input); \ + } + +LEXICAL_CAST_DURATION(milliseconds); +LEXICAL_CAST_DURATION(seconds); +LEXICAL_CAST_DURATION(minutes); +LEXICAL_CAST_DURATION(hours); +LEXICAL_CAST_DURATION(days); +LEXICAL_CAST_DURATION(weeks); +#undef LEXICAL_CAST_DURATION + int main(int argc, char ** argv) { @@ -42,6 +57,8 @@ main(int argc, char ** argv) "Path to write access logs to when the database is unavailable") ("jobs.idle", po::value(&settings.idleJobsAfter)->default_value(settings.idleJobsAfter), "Run idle when there's no activity for this period (ms)") + ("job.parked.freq", po::value(&settings.freqIngestParkedLines)->default_value(settings.freqIngestParkedLines), + "How often to check for and import parked log lines") ; // clang-format on po::variables_map optVars; -- cgit v1.2.3