inst-jobs 2.4.6 → 2.4.7

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: ba509dbe247e504537397a8482595ee6dbeac623c69141a24aa56f753343484f
4
- data.tar.gz: 69502011608a6ac485012dd8ebc5ed9e616b8643ed92a297778100f9ddf51e15
3
+ metadata.gz: 48186ffba65e38c8e10702a68c93d9b4bb7f8ea13f98a7175e6755a1e693595f
4
+ data.tar.gz: 8a6e51516ffeaaa31d8b3bcb07a25e859259b9e734c5a8e14af019d842a01ed7
5
5
  SHA512:
6
- metadata.gz: bba4b9a818f3ce3f0cae2f9d77a556c2d9770a47730328d7b3d6de5c8e5bc338ab24da4a4c5006d68375c9b8c24f24af04a0e711ee71d57b17526c0ca401e275
7
- data.tar.gz: 8ccc1674c9d7f7b1caa27d759a34b9670bc298ece8d85472ba23b83e03cb672cff7372547a84d8c13363aa93447ff0249255f02e5353458d252ef77e1bc89b35
6
+ metadata.gz: 385dcba329c82516cc6ac3b17aa7254cb427fce7d964c40c20ddd64c73a04af0cc687e4626e0dc2af890bf10ef1ec534f355e0dc8203416120c36ec453a9eb71
7
+ data.tar.gz: 42c9316bb0ab5ad237fb70719ddbfa9ba9dc7f4b8dfd75b13880e7be228f9a03b566eb94c0771bdd6672f92919b5c79db4dafd041b1194a3cd4a829a96c006c4
@@ -43,6 +43,11 @@ module Delayed
43
43
  fn_name = connection.quote_table_name("half_md5_as_bigint")
44
44
  connection.select_value("SELECT pg_try_advisory_xact_lock(#{fn_name}('#{lock_name}'));")
45
45
  end
46
+
47
+ def advisory_lock(lock_name)
48
+ fn_name = connection.quote_table_name("half_md5_as_bigint")
49
+ connection.execute("SELECT pg_advisory_xact_lock(#{fn_name}('#{lock_name}'));")
50
+ end
46
51
  end
47
52
 
48
53
  def single_step_create(on_conflict: nil)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Delayed
4
- VERSION = "2.4.6"
4
+ VERSION = "2.4.7"
5
5
  end
@@ -198,7 +198,7 @@ module Delayed
198
198
  next unless jobs.first.locked_at < Time.now.utc - Settings.parent_process[:prefetched_jobs_timeout]
199
199
 
200
200
  Delayed::Job.transaction do
201
- Delayed::Job.connection.execute("SELECT pg_advisory_xact_lock('#{Delayed::Job.prefetch_jobs_lock_name}')")
201
+ Delayed::Job.advisory_lock(Delayed::Job.prefetch_jobs_lock_name)
202
202
  Delayed::Job.unlock(jobs)
203
203
  end
204
204
  @prefetched_jobs[worker_config] = []
@@ -210,7 +210,7 @@ module Delayed
210
210
  next if jobs.empty?
211
211
 
212
212
  Delayed::Job.transaction do
213
- Delayed::Job.connection.execute("SELECT pg_advisory_xact_lock('#{Delayed::Job.prefetch_jobs_lock_name}')")
213
+ Delayed::Job.advisory_lock(Delayed::Job.prefetch_jobs_lock_name)
214
214
  Delayed::Job.unlock(jobs)
215
215
  end
216
216
  end
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.6
4
+ version: 2.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Luetke