From 5c0206f48dc7f90009629d0a74bdc1dd6b4f67ea Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 1 May 2026 17:13:29 +0100 Subject: Rename jobIngestParkedLines to jobReadParkedLines Actual ingest is performed by the main process, jobReadParkedLines just reads the park file and adds it to the queue. --- src/ingestor.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/ingestor.cpp') diff --git a/src/ingestor.cpp b/src/ingestor.cpp index 7fd64cd..e2c315c 100644 --- a/src/ingestor.cpp +++ b/src/ingestor.cpp @@ -116,7 +116,7 @@ namespace WebStat { Ingestor::Ingestor(const utsname & host, DB::ConnectionPoolPtr dbpl, IngestorSettings givenSettings) : settings {std::move(givenSettings)}, dbpool {std::move(dbpl)}, - ingestParkedLines {&Ingestor::jobIngestParkedLines}, purgeOldLogs {&Ingestor::jobPurgeOldLogs}, + ingestParkedLines {&Ingestor::jobReadParkedLines}, purgeOldLogs {&Ingestor::jobPurgeOldLogs}, hostnameId {insert(dbpool->get(), SQL::HOST_UPSERT, SQL::HOST_UPSERT_OPTS, host.nodename, host.sysname, host.release, host.version, host.machine, host.domainname)}, curl {curl_multi_init()}, mainThread {std::this_thread::get_id()} @@ -410,12 +410,12 @@ namespace WebStat { } Ingestor::Job::Result - Ingestor::jobIngestParkedLines() + Ingestor::jobReadParkedLines() { for (auto pathIter = std::filesystem::directory_iterator {settings.fallbackDir}; pathIter != std::filesystem::directory_iterator {}; ++pathIter) { if (scn::scan(pathIter->path().filename().string(), "parked-{:[a-zA-Z0-9]}.log")) { - return [lines = jobIngestParkedLines(pathIter->path()), this, path = pathIter->path()]() mutable { + return [lines = jobReadParkedLines(pathIter->path()), this, path = pathIter->path()]() mutable { auto count = lines.size(); queuedLines.append_range(std::move(lines)); unlink(path.c_str()); @@ -429,12 +429,12 @@ namespace WebStat { } Ingestor::LineBatch - Ingestor::jobIngestParkedLines(const std::filesystem::path & path) + Ingestor::jobReadParkedLines(const std::filesystem::path & path) { if (auto parked = FilePtr(fopen(path.c_str(), "r"))) { if (auto count = scn::scan(parked.get(), "{}\n")) { try { - return jobIngestParkedLines(parked.get(), count->value()); + return jobReadParkedLines(parked.get(), count->value()); } catch (...) { auto failPath = auto {path}.replace_extension(".short"); @@ -447,7 +447,7 @@ namespace WebStat { } Ingestor::LineBatch - Ingestor::jobIngestParkedLines(FILE * lines, size_t count) + Ingestor::jobReadParkedLines(FILE * lines, size_t count) { LineBatch parkedLines; parkedLines.reserve(count); -- cgit v1.3