From ccf1a4c75529158babcde55b7b6f583a02d1cb33 Mon Sep 17 00:00:00 2001 From: Simon Diesenreiter Date: Fri, 13 Nov 2026 00:46:57 +0100 Subject: [PATCH] parlament.press: an explicit backfill_days overrides the cursor Co-Authored-By: Claude Opus 5.5 --- backend/politrack/sources/parlament/news.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/politrack/sources/parlament/news.py b/backend/politrack/sources/parlament/news.py index 93bfad3..2c878f3 100644 --- a/backend/politrack/sources/parlament/news.py +++ b/backend/politrack/sources/parlament/news.py @@ -48,7 +48,11 @@ class ParlamentPress(Adapter): def start(self, ctx: RunContext) -> Iterator[Request]: last = ctx.state.get("last_date") backfill = int(ctx.params.get("backfill_days", 365)) - since = (date.fromisoformat(last) - timedelta(days=2)) if last else date.today() - timedelta(days=backfill) + # an explicit backfill_days (history backfill) wins over the cursor of the regular runs + if last and "backfill_days" not in ctx.params: + since = date.fromisoformat(last) - timedelta(days=2) + else: + since = date.today() - timedelta(days=backfill) yield list_request(110, {"DATERANGE": [since.isoformat(), date.today().isoformat()]}, kind="list", meta={"since": since.isoformat()})