switchman-inst-jobs 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/switchman_inst_jobs/jobs_migrator.rb +12 -9
- data/lib/switchman_inst_jobs/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: e1c01e6bdfd2a5cd3ddd756936a2793526c8e8860883bcd1ea8caa9febad979d
|
4
|
+
data.tar.gz: 4998d1686e5dfceffb5c1a41dcf0959266c8caf73bd99aa0e50e89523e41ba51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aae64990ef75016c24ded178bf0edcf4b4343499b6d226d6c86104d9d15d23bd7a77acf35e622aff989e3292d0abf59bd15d4dd3d20e11e4f9e66e4fe393e581
|
7
|
+
data.tar.gz: 854dd08052ca1b042646ce2fd08c4c0f76d2f5075f11ecebf34f04f8293c3ab2c8d9977817adf2b5e0f6e4c67a6726e49bd4dc9d491b961a391588e78c22a274
|
@@ -230,14 +230,16 @@ module SwitchmanInstJobs
|
|
230
230
|
blocked_shard_ids = blocked_shards.pluck(:id)
|
231
231
|
query = lambda { |column, scope|
|
232
232
|
::Delayed::Job
|
233
|
-
.where(id: ::Delayed::Job
|
234
|
-
.
|
233
|
+
.where(id: ::Delayed::Job
|
234
|
+
.with(all_col: ::Delayed::Job.and(scope).distinct.select(column))
|
235
|
+
.with(blocked_col: ::Delayed::Job.from("all_col").select(column).where.not(
|
236
|
+
::Delayed::Job.select(1)
|
237
|
+
.where(next_in_strand: true).or(::Delayed::Job.where(source: "JobsMigrator::StrandBlocker"))
|
238
|
+
.where("#{column} = all_col.#{column}").arel.exists
|
239
|
+
))
|
240
|
+
.select("DISTINCT ON (#{column}) id")
|
235
241
|
.where.not(shard_id: blocked_shard_ids)
|
236
|
-
.where(
|
237
|
-
::Delayed::Job.select(1).from("#{::Delayed::Job.quoted_table_name} dj2")
|
238
|
-
.where("dj2.next_in_strand = true OR dj2.source = 'JobsMigrator::StrandBlocker'")
|
239
|
-
.where("dj2.#{column} = delayed_jobs.#{column}").arel.exists.not
|
240
|
-
)
|
242
|
+
.where({ column => ::Delayed::Job.from("blocked_col").select(column) })
|
241
243
|
.order(column, :strand_order_override, :id)).limit(batch_size)
|
242
244
|
}
|
243
245
|
|
@@ -249,12 +251,13 @@ module SwitchmanInstJobs
|
|
249
251
|
# batches
|
250
252
|
|
251
253
|
loop do
|
252
|
-
break if query.call(:strand,
|
254
|
+
break if query.call(:strand, ::Delayed::Job.where.not(strand: nil)).update_all(next_in_strand: true).zero?
|
253
255
|
end
|
254
256
|
|
255
257
|
loop do
|
256
258
|
break if query.call(:singleton,
|
257
|
-
|
259
|
+
::Delayed::Job.where(strand: nil)
|
260
|
+
.where.not(singleton: nil)).update_all(next_in_strand: true).zero?
|
258
261
|
end
|
259
262
|
end
|
260
263
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: switchman-inst-jobs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Petty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inst-jobs
|