fix: publish feeds atomically

This commit is contained in:
Abel Luck 2026-05-27 10:57:21 +02:00
parent cbb427b89d
commit e64a32d76b
7 changed files with 253 additions and 4 deletions

View file

@ -31,6 +31,7 @@ from repub.model import (
initialize_database,
load_feed_url,
)
from repub.postprocessing import publish_staged_feed
from repub.spiders.rss_spider import RssFeedSpider
@ -299,6 +300,14 @@ def main(argv: list[str] | None = None) -> int:
return 130
if exit_code == 0:
try:
publish_staged_feed(out_dir=out_dir, feed_slug=feed.slug)
except Exception as error:
print(
f"worker[{args.job_id}:{args.execution_id}]: publish failed: {error}",
flush=True,
)
return 1
print(
f"worker[{args.job_id}:{args.execution_id}]: completed successfully",
flush=True,