diff --git a/config.py b/config.py index ff49358..c62b369 100755 --- a/config.py +++ b/config.py @@ -166,6 +166,9 @@ class NewsConfig: # Must stay below pre_event_buffer_minutes so an event can't cross # into the danger window while a stale cache says it's clear. context_cache_ttl_seconds: int = 600 + # Maximum age of RSS headlines accepted for scoring. Older headlines + # are discarded before keyword analysis and LLM enrichment. + headline_max_age_seconds: int = 43200 # 12 hours rss_feeds: List[str] = field(default_factory=lambda: [ "https://investinglive.com/feed/", diff --git a/news_engine.py b/news_engine.py index 7dc7498..e550e53 100755 --- a/news_engine.py +++ b/news_engine.py @@ -770,8 +770,8 @@ class NewsEngine: pub_date_el.text if pub_date_el is not None else None ) - # Only recent headlines (last 24h) - if pub_date and (datetime.now(timezone.utc) - pub_date).total_seconds() > 86400: + # Only recent headlines (configurable: headline_max_age_seconds) + if pub_date and (datetime.now(timezone.utc) - pub_date).total_seconds() > self.config.headline_max_age_seconds: continue # Dedup within and across feeds so a syndicated story