MC/website/docs/NEWS-DELIVERY-WORKER.md
2026-11-27 23:43:05 +00:00

1.6 KiB

Editorial delivery worker

The public/CP API rebuild retained article persistence and the existing delivery modules but no longer started either news worker. New publications therefore existed in website_posts without a corresponding Discord or forum queue row.

Run the existing Discord and forum outboxes from one dedicated service, independently of blue/green web candidates. website/ops/news-delivery-worker.mjs loads the active release's existing database adapter and delivery modules. Install it root-owned as /usr/local/lib/dunerealms-news-delivery.mjs with the matching dunerealms-news-delivery.service unit. It runs as the existing dunerealms service identity, reads the existing private environment/configuration and requires no new webhook or role grant.

The worker starts both existing outboxes, serialises its own passes, keeps running between publications and waits for an active pass before closing the database. Existing claims, Discord baseline markers, message IDs, forum source markers, revision hashes and uncertain states remain authoritative. It never resets sent/baseline/uncertain records to resend old announcements. Drafts and future articles remain excluded by the original modules.

After installation, verify the unit is active and inspect the newest published article's discord_news_delivery and forum_news_delivery rows. Claim Discord success only after a confirmed message ID and forum success only after a confirmed topic ID/source revision. Do not send a synthetic announcement to test the integration. Restart this dedicated unit when changing delivery modules; do not start additional senders inside each web slot.