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 +4 -4
- data/CHANGES.md +3 -0
- data/lib/sidekiq/killswitch/middleware/server.rb +5 -3
- data/lib/sidekiq/killswitch/version.rb +1 -1
- data/spec/middleware/server_spec.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce3724e1e338f618383c5457d27d56b2915e6711
|
4
|
+
data.tar.gz: c2aa676ea6fa4c7e0298dd6b611f9550c8e581ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2700cff628ba1a7f24e15ee410ae514011e574839842654aad6a63a563b41d4d7b2641bd0c0536435114e6489e2face8dcadecad5d02b936644b202b90abe55
|
7
|
+
data.tar.gz: 5484328ca71f6eb37acaea3c08141b603c216bcd790bdc4fd861b9047ab81cab5679001c9a798c3f371531e6e105d0f620d18dd878c8d04b840a02ab6f0e1ceb
|
data/CHANGES.md
CHANGED
@@ -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(
|
10
|
-
Killswitch.logger.info "#{worker.class.name} marked as dead queue worker. Job #{
|
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 #{
|
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
|
@@ -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 =
|
30
|
-
|
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.
|
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-
|
11
|
+
date: 2017-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|