Skip to content

fix(scheduler): cron jobs run single-runner via a Postgres advisory lock - #678

Open
yggdrasilworld wants to merge 1 commit into
MergeFi:mainfrom
yggdrasilworld:fix/cron-single-runner-586
Open

yggdrasilworld wants to merge 1 commit into
MergeFi:mainfrom
yggdrasilworld:fix/cron-single-runner-586

Conversation

@yggdrasilworld

Copy link
Copy Markdown

What

Plain @Cron fired on EVERY replica — with N replicas the bounty-expiry + idempotency-cleanup sweeps ran N times an hour, racing the same rows.

Fix

Wrap each in pg_try_advisory_lock — only the lock-holding replica sweeps; the others return immediately.

Resolves #586

Plain @Cron fired on EVERY replica — with N replicas the bounty-expiry and
idempotency-cleanup sweeps ran N times an hour, racing the same rows. Wrap
each in pg_try_advisory_lock so only the lock-holding replica sweeps.

Resolves MergeFi#586
@vercel

vercel Bot commented Oct 14, 2026

Copy link
Copy Markdown

@yggdrasilworld is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@Cron jobs run on every replica — bounty expiry and idempotency cleanup execute N times concurrently in a multi-instance deploy

1 participant