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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02cb2ab5274e3a6616a74bb75cc8c74cd767c850cfb5451931e08ff582096238
4
- data.tar.gz: 045a1caa153d01bb8f9ec756bb53777efe564597822d71e58652ef4a86e6a2d5
3
+ metadata.gz: e30b7bf2c44f2397ae1db0e70f1590db4f212e125df4b1e4649351f8f5c54a34
4
+ data.tar.gz: 6fbefaef9136f3f7364c3fe12afe2be9010ea90a5a9571a4ff23cfdd41f74019
5
5
  SHA512:
6
- metadata.gz: 5be013e7266ffad6f13bfb0020adf1f8c1b7cae8041bcb03e2840f1c9073de265f61ed2054434faa8abcb33f0ce3c89e800b941fa6c107f005a254a1cdf4fc3b
7
- data.tar.gz: 49b689debce5e7bb40313905ded5af1b7232c4a2224e2e42f1637902d66c9e4ddadd64139d48593a78a54afbe539451f16708df43067efcabd1997c433ecd7e5
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.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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Delayed
4
- VERSION = "2.4.0"
4
+ VERSION = "2.4.1"
5
5
  end
@@ -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.0
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-03 00:00:00.000000000 Z
12
+ date: 2021-09-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord