switchman-inst-jobs 4.0.12 → 4.0.13

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: e4081fb390625cd34169a6585ffaddb12143403e3545988a1ada3ca90d34dc2d
4
- data.tar.gz: 2f60cfa5de1529a206115bd2d68758f41f71763afbdaa980095de67dda1da544
3
+ metadata.gz: 8663d7c19e1900c68ab1595b7306cc2105233b1aa02bb687beee88cdbfa9ada5
4
+ data.tar.gz: 63f99e858a89ff31c8cda4a1dd35e072e58cda21ebf9d1cdb6a7434ad37f5968
5
5
  SHA512:
6
- metadata.gz: 86bb9901b00dd38410092f17e15e1ff9b70b4907426ad32b7f2779a65844d7442e01e8df056d2293c90354eb814e880068854713e9169099e7d772294fc0a1d9
7
- data.tar.gz: 9376187ebecfaab79e07696fd44ed762694e5ed06e9b539183f93f0f49e9706fa9eef59d6e9ef5456bccae2be780360d021da600e854eb8f2afcace71ca25bb5
6
+ metadata.gz: '0322296a92637bb28cc00cfe41446fc39eb189fb4c5e433fb1adf115f1ab80204d91228c96a5902d5f2ece3906805e478ecf166dee37ef9d17b7ce9d4c28c1bd'
7
+ data.tar.gz: 769694ebfd1343c2449b18b14b8883aaab0cf3819e01446878328461542657d31df576501db5539f572cf5bae8ca5c460354e960e4c27f3b3996a6c3439894c4
@@ -285,8 +285,7 @@ module SwitchmanInstJobs
285
285
  ::Delayed::Job.
286
286
  where.not(strand: nil).
287
287
  group(:strand).
288
- having('NOT BOOL_OR(next_in_strand)').
289
- pluck(:strand)
288
+ having('NOT BOOL_OR(next_in_strand)')
290
289
  end
291
290
 
292
291
  def unblock_strand!(strand, new_parallelism: nil)
@@ -315,8 +314,7 @@ module SwitchmanInstJobs
315
314
  where(strand: nil).
316
315
  where.not(singleton: nil).
317
316
  group(:singleton).
318
- having('NOT BOOL_OR(next_in_strand)').
319
- pluck(:singleton)
317
+ having('NOT BOOL_OR(next_in_strand)')
320
318
  end
321
319
 
322
320
  def unblock_singleton!(singleton)
@@ -338,6 +336,12 @@ module SwitchmanInstJobs
338
336
  end
339
337
  end
340
338
 
339
+ def blocked_job_count
340
+ ::Delayed::Job.from(blocked_strands.select('count(id) AS ssize')).sum('ssize').to_i +
341
+ ::Delayed::Job.from(blocked_singletons.select('count(id) AS ssize')).sum('ssize').to_i +
342
+ ::Delayed::Job.where(strand: nil, singleton: nil, next_in_strand: false).count
343
+ end
344
+
341
345
  private
342
346
 
343
347
  def create_blocker_job(**kwargs)
@@ -1,3 +1,3 @@
1
1
  module SwitchmanInstJobs
2
- VERSION = '4.0.12'.freeze
2
+ VERSION = '4.0.13'.freeze
3
3
  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.0.12
4
+ version: 4.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Petty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-21 00:00:00.000000000 Z
11
+ date: 2022-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inst-jobs