switchman-inst-jobs 3.2.9 → 3.2.10

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: 4f4d9ba9513be35bfcc25eb4273305aea1474ed42299bd7a45675cf6476e4eb1
4
- data.tar.gz: 7d2222fa91a0a3ad4f5d19bb8705b118b909608608b29b2188e0d45bfad30f1e
3
+ metadata.gz: c7c79b622db6622d52f9fa4bc58b4b4bcd199ac246c93af1330b93f724ecec6b
4
+ data.tar.gz: efa9db49c224a20c03cdb28e4c97b4071864bb8b2d7efd6c16469eeb6a32544a
5
5
  SHA512:
6
- metadata.gz: b9fd01c47c6d4c9a4556a41a53bdcf54c43c8f1d1ce25109decafbf2ee3bf4b4fa155e3c284ecb4cbf3d5a52b99eff2fc08aa743bf73bb9c0eb93cb4e63c4f03
7
- data.tar.gz: 919c31f442cd5eb1cbeb6fb1669b20f6abeec5f1c58d9fb0b3dedb978d3ae66a9fd2d9f1f7195f6fec79982c02f1510ae686a0c55397c32dac5666270e4bc27d
6
+ metadata.gz: 3978fd1d2abc5f0adda8caeb77891153eda538e470712a2472268b104e989c573851a110db6a1e60c894a95b21ba66a348b403dcab68684e762765b8952729b8
7
+ data.tar.gz: 67dfe54fc06dcf591b129d6aeda70c9019400696a3052b12e43d043a943dcd2db52f962de05acc45125e6f2824d99d9d9c72e6db4232b31adcaf9c3c1ade0512
@@ -127,7 +127,13 @@ module SwitchmanInstJobs
127
127
  # the lock ensures the blocker always gets unlocked
128
128
  first = value_scope.where.not(locked_by: nil).next_in_strand_order.lock.first
129
129
  if first
130
- create_blocker_job(queue: first.queue, **{ column => value }, **blocker_job_kwargs)
130
+ create_blocker_job(
131
+ queue: first.queue,
132
+ shard_id: first.shard_id,
133
+ **{ column => value },
134
+ **blocker_job_kwargs
135
+ )
136
+
131
137
  # the rest of 3) is taken care of here
132
138
  # make sure that all the jobs moved over are NOT next in strand
133
139
  ::Delayed::Job.where(next_in_strand: true, locked_by: nil, **{ column => value }).
@@ -160,12 +166,15 @@ module SwitchmanInstJobs
160
166
  locked_by: ::Delayed::Backend::Base::ON_HOLD_BLOCKER
161
167
  }
162
168
 
169
+ quoted_function_name = ::Delayed::Job.connection.quote_table_name('half_md5_as_bigint')
163
170
  strand_advisory_lock_fn = lambda do |value|
164
- ::Delayed::Job.connection.execute("SELECT pg_advisory_xact_lock(half_md5_as_bigint('#{value}'))")
171
+ ::Delayed::Job.connection.execute("SELECT pg_advisory_xact_lock(#{quoted_function_name}('#{value}'))")
165
172
  end
166
173
 
167
174
  singleton_advisory_lock_fn = lambda do |value|
168
- ::Delayed::Job.connection.execute("SELECT pg_advisory_xact_lock(half_md5_as_bigint('singleton:#{value}'))")
175
+ ::Delayed::Job.connection.execute(
176
+ "SELECT pg_advisory_xact_lock(#{quoted_function_name}('singleton:#{value}'))"
177
+ )
169
178
  end
170
179
 
171
180
  handler.call(strand_scope, :strand, {}, strand_advisory_lock_fn)
@@ -1,3 +1,3 @@
1
1
  module SwitchmanInstJobs
2
- VERSION = '3.2.9'.freeze
2
+ VERSION = '3.2.10'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: switchman-inst-jobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.9
4
+ version: 3.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Petty