diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-12-20 15:12:53 +0000 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-12-20 15:12:53 +0000 |
| commit | 4a640858b83120bee217d91339f7bc39175989c1 (patch) | |
| tree | 8c1708eb7919e1859dbb0f61e260a4d6cb37b445 /src/webstat_logger_main.cpp | |
| parent | a19c28924d28f3633727bf86f92a0aaeb9ed7692 (diff) | |
| download | webstat-4a640858b83120bee217d91339f7bc39175989c1.tar.bz2 webstat-4a640858b83120bee217d91339f7bc39175989c1.tar.xz webstat-4a640858b83120bee217d91339f7bc39175989c1.zip | |
Add support for configuring frequency of parked line job
Diffstat (limited to 'src/webstat_logger_main.cpp')
| -rw-r--r-- | src/webstat_logger_main.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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 <boost/program_options.hpp> #include <format> #include <iostream> @@ -18,6 +19,20 @@ namespace { } } +#define LEXICAL_CAST_DURATION(UNIT) \ + template<> std::chrono::UNIT boost::lexical_cast<std::chrono::UNIT, std::string>(const std::string & input) \ + { \ + return WebStat::parseDuration<std::chrono::UNIT::rep, std::chrono::UNIT::period>(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; |
