From 770c173c43843ac57d3f8d1421d6542953568bcb Mon Sep 17 00:00:00 2001 From: Andrii Nikitin Date: Mon, 16 Dec 2019 12:51:59 +0100 Subject: [PATCH] Fix concurrency in Pg::unlock --- lib/Minion/Backend/Pg.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Minion/Backend/Pg.pm b/lib/Minion/Backend/Pg.pm index 00161063..58c23363 100644 --- a/lib/Minion/Backend/Pg.pm +++ b/lib/Minion/Backend/Pg.pm @@ -271,7 +271,7 @@ sub unlock { !!shift->pg->db->query( 'delete from minion_locks where id = ( select id from minion_locks - where expires > now() and name = ? order by expires limit 1 + where expires > now() and name = ? order by expires limit 1 for update ) returning 1', shift )->rows; }