inst-jobs 0.15.19 → 0.15.20
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 +4 -2
- data/lib/delayed/periodic.rb +4 -1
- data/lib/delayed/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17a98186a4f5f1038958a84bfc19884179c91d2afc5ec92f6e61967ab76dceb0
|
4
|
+
data.tar.gz: bfacc6d2201f5a5e7741f793b8042cb5c32434254ec82dcf76003e3dae539c2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18bbbbc13154cd9dc95a26f2fe3e3c3cc30759740c049c85e65b5de1ed4e2dd28130685f86b50139889fd493785ad513dd55f1023cb845f8cb98bbdf866b55c3
|
7
|
+
data.tar.gz: 3d7cf731a725967f7b99066c7a330f266450541782e5aef0962d6832a8a0eda56119b36ffe9bb4dc3e22c0be02fafc8383366763dfe6425cfc392bbeade1e28e
|
@@ -377,7 +377,9 @@ module Delayed
|
|
377
377
|
def self.transaction_for_singleton(strand, on_conflict)
|
378
378
|
return yield if on_conflict == :loose
|
379
379
|
self.transaction do
|
380
|
-
|
380
|
+
function = on_conflict == :patient ? 'pg_try_advisory_xact_lock' : 'pg_advisory_xact_lock'
|
381
|
+
result = connection.select_value(sanitize_sql(["SELECT #{function}(#{connection.quote_table_name('half_md5_as_bigint')}(?))", strand]))
|
382
|
+
return if result == false && on_conflict == :patient
|
381
383
|
yield
|
382
384
|
end
|
383
385
|
end
|
@@ -396,7 +398,7 @@ module Delayed
|
|
396
398
|
new_job.initialize_defaults
|
397
399
|
job.run_at =
|
398
400
|
case on_conflict
|
399
|
-
when :use_earliest
|
401
|
+
when :use_earliest, :patient
|
400
402
|
[job.run_at, new_job.run_at].min
|
401
403
|
when :overwrite
|
402
404
|
new_job.run_at
|
data/lib/delayed/periodic.rb
CHANGED
@@ -47,7 +47,10 @@ class Periodic
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def enqueue
|
50
|
-
Delayed::Job.enqueue(self, @job_args.merge(:max_attempts => 1,
|
50
|
+
Delayed::Job.enqueue(self, @job_args.merge(:max_attempts => 1,
|
51
|
+
:run_at => @cron.next_time(Delayed::Periodic.now).utc.to_time,
|
52
|
+
:singleton => tag,
|
53
|
+
on_conflict: :patient))
|
51
54
|
end
|
52
55
|
|
53
56
|
def perform
|
data/lib/delayed/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inst-jobs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Luetke
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-04-
|
12
|
+
date: 2020-04-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|