boy_band 0.1.12 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/boy_band.rb +8 -8
  3. metadata +6 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6d040e078153295146fa37e5781a107ad5aea4dd16727dc3d63bcd4e25821d2
4
- data.tar.gz: ea5ae60dc466b1a660666d4db41d6c0a0e1b690f8ee2b9d2c1830936f9faae8a
3
+ metadata.gz: 4cd78f34f6e59840ca1c26e224ae07c6c00474d359b251cc510bbe73206b7091
4
+ data.tar.gz: d1fd4e70195819e3a7e176323e9c0a73027c18aeee6fa643e8d1bbf01669d649
5
5
  SHA512:
6
- metadata.gz: db4df288e482fb66d80d370d522a64bb60c7d32d2aeb14eaaa2ddb03742cd78b00ed3455acb151f00168a0dcc6339c4ae44e4758293ba1085a9009cc42b3ea1c
7
- data.tar.gz: 57ea5a67822e98c108c30ff200c971b68136f4a459069353d1899705ecc47eca1193829b701a8f56a36c8b49962c2f018edd179137110f3be5d3f673af045932
6
+ metadata.gz: 6caebc3b98d4caa82b28f16a9491b35ebf82afcf0e5bbd5fbeba65389ecb6cbb103188073f4a3b55acbb8862d05fd6388a9aae9afcbd1fb871518b03ab68f266
7
+ data.tar.gz: d145d07df99f98d0827e4126d349bbf26c33a877452fbb729948c0f70992c4ee9c73aa942ff6c3ee33b3587070290060f403baa04cbf54fc2face5a2aaaef96b
@@ -69,13 +69,13 @@ module BoyBand
69
69
  chain_args = [chain_args[0]['method'],chain_args[0]['id'],chain_args[0]['arguments'].to_s[0, 20]]
70
70
  end
71
71
  chain.push("#{klass.to_s},#{method_name.to_s},#{chain_args.join('+')}")
72
- Rails.logger.warn("jobchain set, #{chain[0]} #{chain.join('##')}") if chain.length > 2
72
+ # Rails.logger.warn("jobchain set, #{chain[0]} #{chain.join('##')}") if chain.length > 2
73
73
  if chain.length > 5
74
- Rails.logger.error("jobchain too deep: #{chain[0]}, #{chain.length} entries")
74
+ Rails.logger.error("jobchain too deep: #{chain[1]}, #{chain.length} entries")
75
75
  end
76
76
  job_count = Resque.redis.get("jobs_from_#{chain[0]}")
77
77
  if job_count && job_count.to_i > 50
78
- Rails.logger.error("jobchain too many sub-jobs: #{chain[0]}, #{job_count} so far")
78
+ Rails.logger.error("jobchain too many sub-jobs: #{chain[1]}, #{job_count} so far")
79
79
  end
80
80
  args.push("chain::#{chain.join('##')}")
81
81
  if queue == :slow
@@ -188,14 +188,14 @@ module BoyBand
188
188
  idx = Resque.size(queue)
189
189
  idx.times do |i|
190
190
  item = Resque.peek(queue, i)
191
- if item['args'] && item['args'][-1].match(/^chain::/)
191
+ if item && item['args'] && item['args'][-1].match(/^chain::/)
192
192
  chain = item['args'].pop
193
193
  end
194
- if item['args'] && item['args'][-1].match(/^domain::/)
194
+ if item && item['args'] && item['args'][-1].match(/^domain::/)
195
195
  domain = item['args'].pop
196
196
  item['domain_id'] = domain.split(/::/, 2)[1]
197
197
  end
198
- res << item
198
+ res << item if item
199
199
  end
200
200
  end
201
201
  res
@@ -255,7 +255,7 @@ module BoyBand
255
255
  list = []
256
256
  idx.times do |i|
257
257
  item = Resque.peek(queue, i)
258
- if item['args'] && item['args'][2].is_a?(Hash) && item['args'][2]['method'] == method
258
+ if item && item['args'] && item['args'][2].is_a?(Hash) && item['args'][2]['method'] == method
259
259
  list << item
260
260
  puts item.to_json
261
261
  end
@@ -277,7 +277,7 @@ module BoyBand
277
277
  return true if Resque.redis.get("scheduled/#{klass.to_s}/#{method_name}/#{job_hash}") == "t"
278
278
  return false if idx > 500 # big queues mustn't be searched this way
279
279
  idx = Resque.size(queue)
280
- queue_class = (queue == :slow ? 'SlowWorker' : 'Worker')
280
+ queue_class = (queue.to_s == 'slow' ? 'SlowWorker' : 'Worker')
281
281
  if false
282
282
  job_hash = args_copy.to_json
283
283
  timestamps = JSON.parse(Resque.redis.hget('hashed_jobs', job_hash) || "[]")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boy_band
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Whitmer
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-31 00:00:00.000000000 Z
11
+ date: 2020-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -66,7 +66,7 @@ homepage: http://github.com/CoughDrop/boy_band
66
66
  licenses:
67
67
  - MIT
68
68
  metadata: {}
69
- post_install_message:
69
+ post_install_message:
70
70
  rdoc_options: []
71
71
  require_paths:
72
72
  - lib
@@ -81,9 +81,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  requirements: []
84
- rubyforge_project:
85
- rubygems_version: 2.7.7
86
- signing_key:
84
+ rubygems_version: 3.0.8
85
+ signing_key:
87
86
  specification_version: 4
88
87
  summary: BoyBand
89
88
  test_files: []