inst-jobs 2.4.0 → 2.4.1
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 +1 -1
- data/lib/delayed/version.rb +1 -1
- data/spec/shared/shared_backend.rb +17 -0
- 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: e30b7bf2c44f2397ae1db0e70f1590db4f212e125df4b1e4649351f8f5c54a34
|
4
|
+
data.tar.gz: 6fbefaef9136f3f7364c3fe12afe2be9010ea90a5a9571a4ff23cfdd41f74019
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96816f9b736391a18cf292795c3b86cd3f255d4455cfbc9225d16876c64afa083206268f385b8abf7ab78c66165c40a7408f179034d19f5b5a9de101ad30f078
|
7
|
+
data.tar.gz: 052c17277bca1edbc763aa0efbffed110898b4069c82fbd6242f7ca232b06e4d0deecc8a2a91e82b9876e4a50ba3ab0a6d7e9767a0c70c0a7aecb7ed224bb2c5
|
@@ -99,7 +99,7 @@ module Delayed
|
|
99
99
|
sql = "SELECT pg_advisory_xact_lock(#{fn_name}(#{connection.quote(values['strand'])})); #{sql}"
|
100
100
|
end
|
101
101
|
result = connection.execute(sql, "#{self} Create")
|
102
|
-
self.id = result.values.first
|
102
|
+
self.id = result.values.first&.first
|
103
103
|
result.clear
|
104
104
|
else
|
105
105
|
result = connection.exec_query(sql, "#{self} Create", binds)
|
data/lib/delayed/version.rb
CHANGED
@@ -474,6 +474,23 @@ shared_examples_for "a backend" do
|
|
474
474
|
expect(Delayed::Job.get_and_lock_next_available("w1")).to be_nil
|
475
475
|
end
|
476
476
|
end
|
477
|
+
|
478
|
+
context "with on_conflict: loose and strand-inferred-from-singleton" do
|
479
|
+
around do |example|
|
480
|
+
Delayed::Settings.infer_strand_from_singleton = true
|
481
|
+
example.call
|
482
|
+
ensure
|
483
|
+
Delayed::Settings.infer_strand_from_singleton = false
|
484
|
+
end
|
485
|
+
|
486
|
+
it "does not create if there's another non-running job on the strand" do
|
487
|
+
@job = create_job(singleton: "myjobs", on_conflict: :loose)
|
488
|
+
expect(@job).to be_present
|
489
|
+
|
490
|
+
@job2 = create_job(singleton: "myjobs", on_conflict: :loose)
|
491
|
+
expect(@job2).to be_new_record
|
492
|
+
end
|
493
|
+
end
|
477
494
|
end
|
478
495
|
end
|
479
496
|
|
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: 2.4.
|
4
|
+
version: 2.4.1
|
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: 2021-09-
|
12
|
+
date: 2021-09-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|