inst-jobs 0.15.17 → 0.15.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/delayed/backend/active_record.rb +3 -1
- data/lib/delayed/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f5fa07aabb776db7b07347664cd263fae34426050ea23b72e2f35ef6a665f46
|
4
|
+
data.tar.gz: cfb860844d1a2c3654a8047f8c32331fab957f6fd1d5ac77f641f2704849d738
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9dd503fd8af0128fc999a78f96b199f759ea1c9df121f816ee72dd288d2e6bc6480b69bdece15f8f32c167e9785d18d9fb4b262abfd8459e08c12771d3dbe606
|
7
|
+
data.tar.gz: cb4f63db74b2cd05fde625c43e100c07cd66ded4f3b0998d97bb19786befde179180b85b1dd45d193254bdd010aba9e2ddaf67b549d0e8cdc0657853b99146ed
|
@@ -264,12 +264,14 @@ module Delayed
|
|
264
264
|
# jobs in a single query.
|
265
265
|
effective_worker_names = Array(worker_names)
|
266
266
|
|
267
|
+
lock = nil
|
268
|
+
lock = "FOR UPDATE SKIP LOCKED" if connection.postgresql_version >= 90500
|
267
269
|
target_jobs = all_available(queue,
|
268
270
|
min_priority,
|
269
271
|
max_priority,
|
270
272
|
forced_latency: forced_latency).
|
271
273
|
limit(effective_worker_names.length + prefetch).
|
272
|
-
lock
|
274
|
+
lock(lock)
|
273
275
|
jobs_with_row_number = all.from(target_jobs).
|
274
276
|
select("id, ROW_NUMBER() OVER () AS row_number")
|
275
277
|
updates = "locked_by = CASE row_number "
|
data/lib/delayed/version.rb
CHANGED