Kichik maslahat: Postgres da FOR UPDATE SKIP LOCKED bilan oddiy navbat Redis siz ham yaxshi ishlaydi.
update jobs set locked_at = now()
where id in (
select id from jobs where locked_at is null
order by run_at limit 10
for update skip locked
) returning *;