Skip to content

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

Closed
yggdrasilworld wants to merge 3 commits into
MergeFi:mainfrom
yggdrasilworld:fix/cron-single-runner-586
Closed

yggdrasilworld wants to merge 3 commits into
MergeFi:mainfrom
yggdrasilworld:fix/cron-single-runner-586

Conversation

@yggdrasilworld

@yggdrasilworld yggdrasilworld commented Oct 14, 2026 •

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

Payment: Base USDC 0xD40Df5c27cEa7dd78A3c345401995c319589334e

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.

yggdrasilworld and others added 2 commits October 18, 2026 21:50
The shared base carried half-written merge artifacts: an orphaned
invokeOnLockedEscrow block in escrow.service.ts, duplicated returns plus
a dead parsePagination in sponsors.controller.ts, and missing
describe/it closers in github-webhooks.service.spec.ts. Aligned each
with the intended form so the branch typechecks and its specs load.
@yggdrasilworld
yggdrasilworld deleted the fix/cron-single-runner-586 branch October 19, 2026 02:34
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

2 participants