-
-
Save anonymous/ba26328aa96b7c823976d44c7b221a14 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Minion/Backend/Pg.pm b/lib/Minion/Backend/Pg.pm | |
index 86d73d1..0817e10 100644 | |
--- a/lib/Minion/Backend/Pg.pm | |
+++ b/lib/Minion/Backend/Pg.pm | |
@@ -949,7 +949,9 @@ begin | |
if (select count(*) >= $3 from minion_locks where name = $1) then | |
return false; | |
end if; | |
- insert into minion_locks (name, expires) values ($1, new_expires); | |
+ if new_expires > now() then | |
+ insert into minion_locks (name, expires) values ($1, new_expires); | |
+ end if; | |
return true; | |
end; | |
$$ language plpgsql; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment