mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-15 10:04:44 +00:00
Formatted src/services/enrichment/wikipedia
This commit is contained in:
@@ -21,10 +21,10 @@ std::string WikipediaEnrichmentService::FetchExtract(std::string_view query) {
|
||||
if (const auto cache_it = this->extract_cache_.find(cache_key);
|
||||
cache_it != this->extract_cache_.end()) {
|
||||
if (logger_) {
|
||||
logger_->Log(
|
||||
{.level = LogLevel::Debug,
|
||||
logger_->Log({.level = LogLevel::Debug,
|
||||
.phase = PipelinePhase::Enrichment,
|
||||
.message = std::format("Wikipedia: Cache hit for {}!", cache_key)});
|
||||
.message = std::format("Wikipedia: Cache hit for {}!",
|
||||
cache_key)});
|
||||
}
|
||||
return cache_it->second;
|
||||
}
|
||||
@@ -121,10 +121,10 @@ std::string WikipediaEnrichmentService::FetchExtract(std::string_view query) {
|
||||
// Handle 404/Missing status
|
||||
if (page.contains("missing")) {
|
||||
if (logger_) {
|
||||
logger_->Log(
|
||||
{.level = LogLevel::Warn,
|
||||
logger_->Log({.level = LogLevel::Warn,
|
||||
.phase = PipelinePhase::Enrichment,
|
||||
.message = std::format("WikipediaService: Page '{}' does not exist",
|
||||
.message = std::format(
|
||||
"WikipediaService: Page '{}' does not exist",
|
||||
std::string(query))});
|
||||
}
|
||||
this->extract_cache_.emplace(cache_key, "");
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
|
||||
#include "services/enrichment/wikipedia_service.h"
|
||||
|
||||
std::string WikipediaEnrichmentService::GetLocationContext(
|
||||
const City& loc) {
|
||||
std::string WikipediaEnrichmentService::GetLocationContext(const City& loc) {
|
||||
using namespace std::literals::chrono_literals;
|
||||
if (!this->client_) {
|
||||
if (logger_) {
|
||||
@@ -53,10 +52,10 @@ std::string WikipediaEnrichmentService::GetLocationContext(
|
||||
|
||||
} catch (const std::runtime_error& e) {
|
||||
if (logger_) {
|
||||
logger_->Log(
|
||||
{.level = LogLevel::Debug,
|
||||
logger_->Log({.level = LogLevel::Debug,
|
||||
.phase = PipelinePhase::Enrichment,
|
||||
.message = std::format("WikipediaService lookup failed for '{}': {}",
|
||||
.message = std::format(
|
||||
"WikipediaService lookup failed for '{}': {}",
|
||||
location_query, e.what())});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user