sidekiq-killswitch 1.0.0.pre1 → 1.0.0.pre2

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
  SHA1:
3
- metadata.gz: 2023dc6b7f1c2086d73428e131a5defff2bf6df7
4
- data.tar.gz: 237c0c4774e0e25ba4847cb5605b3df1eb0dff6e
3
+ metadata.gz: ce3724e1e338f618383c5457d27d56b2915e6711
4
+ data.tar.gz: c2aa676ea6fa4c7e0298dd6b611f9550c8e581ec
5
5
  SHA512:
6
- metadata.gz: 41bb8c22d0b8bbbd5319e897ba827191740836dc2d3bcc556eaa63c1f23ba7b37dd2b50a334d91af76c3a1340d7fc134f933c404d94f74f78f7a90b9bb2845a7
7
- data.tar.gz: e74e50db1d9dc5ea4259fd87943c7bddf7d5ff6e7d46d0ca509e28f113ea5ebf764fae687eb190ab00c6c43b2f548d754596efed498eb9c63828e8ae8e98804e
6
+ metadata.gz: f2700cff628ba1a7f24e15ee410ae514011e574839842654aad6a63a563b41d4d7b2641bd0c0536435114e6489e2face8dcadecad5d02b936644b202b90abe55
7
+ data.tar.gz: 5484328ca71f6eb37acaea3c08141b603c216bcd790bdc4fd861b9047ab81cab5679001c9a798c3f371531e6e105d0f620d18dd878c8d04b840a02ab6f0e1ceb
data/CHANGES.md CHANGED
@@ -1,2 +1,5 @@
1
1
  ### 1.0.0.pre1 / 2017-08-14
2
2
  * Initial release - wip
3
+
4
+ ### 1.0.0.pre2 / 2017-08-14
5
+ * Bugfix: job hash serialization before putting to the dead queue
@@ -5,11 +5,13 @@ module Sidekiq
5
5
  module Middleware
6
6
  class Server
7
7
  def call(worker, job, _queue)
8
+ serialized_job = Sidekiq.dump_json(job)
9
+
8
10
  if Killswitch.dead_queue_worker?(worker.class)
9
- DeadSet.new.kill(job)
10
- Killswitch.logger.info "#{worker.class.name} marked as dead queue worker. Job #{job} was killed."
11
+ DeadSet.new.kill(serialized_job)
12
+ Killswitch.logger.info "#{worker.class.name} marked as dead queue worker. Job #{serialized_job} was killed."
11
13
  elsif Killswitch.blackhole_worker?(worker.class)
12
- Killswitch.logger.info "#{worker.class.name} is currently disabled. Job #{job} was not executed."
14
+ Killswitch.logger.info "#{worker.class.name} is currently disabled. Job #{serialized_job} was not executed."
13
15
  else
14
16
  yield
15
17
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sidekiq
4
4
  module Killswitch
5
- VERSION = '1.0.0.pre1'
5
+ VERSION = '1.0.0.pre2'
6
6
  end
7
7
  end
@@ -26,8 +26,9 @@ RSpec.describe Sidekiq::Killswitch::Middleware::Server do
26
26
  it 'should send a job to the morgue' do
27
27
  Sidekiq::Killswitch.dead_queue_add_worker(MyWorker)
28
28
 
29
- job_data = double
30
- expect_any_instance_of(Sidekiq::DeadSet).to receive(:kill).with(job_data)
29
+ job_data = {job: :details}
30
+ serialized_job = Sidekiq.dump_json(job_data)
31
+ expect_any_instance_of(Sidekiq::DeadSet).to receive(:kill).with(serialized_job)
31
32
 
32
33
  expect do
33
34
  server_middleware.call(MyWorker.new, job_data, nil) { raise 'Should not run' }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-killswitch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre1
4
+ version: 1.0.0.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuriy Naidyon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-21 00:00:00.000000000 Z
11
+ date: 2017-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq