From Dev.to
Quick tip: one Postgres advisory lock stops your scheduled job running twice
You scaled your app from one server to two. Everything got faster, except that the nightly invoice job now runs twice, and some customers got two invoices. It's one of the most common surprises in gro...
