worker_killer 1.0.1.75538 → 1.0.1.83603
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/worker_killer/delayed_job_plugin.rb +1 -1
- data/spec/count_limiter_spec.rb +1 -1
- data/spec/killer_spec.rb +9 -3
- data/spec/memory_limiter_spec.rb +1 -1
- data/spec/middleware_spec.rb +3 -3
- 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: af1736e1bb8f2bfc3c3aa9e93d2fa1aa429173dc2389e7969c24210479e90441
|
4
|
+
data.tar.gz: f472d15158b29d0a920e49f873b46edcc19f554c0d3a75cfe33cf43b195ed0d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2796b66e4f0069df66073c2acdc2cefa7c2213efdf36ddaf7a76e63cdc9bf53ffe4b369406bb8e6dd890d6f242b47f44fcd4cfde83e73b499f8d1e002097a8bd
|
7
|
+
data.tar.gz: a3d13754ae85c50564e8b825d61ec8d0397b1e664647e3b18a4423426f081b6a6bada3e26941773415856afa1e5abab8fdf04a88045beb2f2b704054f0d1517e
|
data/spec/count_limiter_spec.rb
CHANGED
data/spec/killer_spec.rb
CHANGED
@@ -19,9 +19,15 @@ RSpec.describe WorkerKiller::Killer::Base do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
it 'expect right signal order' do
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
if RUBY_VERSION >= "3.0.0"
|
23
|
+
expect(killer).to receive(:do_kill).with(:QUIT, anything, anything).exactly(2).times
|
24
|
+
expect(killer).to receive(:do_kill).with(:TERM, anything, anything).exactly(2).times
|
25
|
+
expect(killer).to receive(:do_kill).with(:KILL, anything, anything).exactly(5).times
|
26
|
+
else
|
27
|
+
expect(killer).to receive(:do_kill).with(:QUIT, anything, anything, anything).exactly(2).times
|
28
|
+
expect(killer).to receive(:do_kill).with(:TERM, anything, anything, anything).exactly(2).times
|
29
|
+
expect(killer).to receive(:do_kill).with(:KILL, anything, anything, anything).exactly(5).times
|
30
|
+
end
|
25
31
|
|
26
32
|
2.times { killer.kill(Time.now) } # 2 QUIT
|
27
33
|
2.times { killer.kill(Time.now) } # 2 TERM
|
data/spec/memory_limiter_spec.rb
CHANGED
data/spec/middleware_spec.rb
CHANGED
@@ -9,7 +9,7 @@ RSpec.describe WorkerKiller::Middleware do
|
|
9
9
|
describe 'Custom class' do
|
10
10
|
let(:klass){ double }
|
11
11
|
let(:options){ { killer: killer, klass: klass, reaction: reaction, anykey: anykey } }
|
12
|
-
subject{ described_class.new(app, options) }
|
12
|
+
subject{ described_class.new(app, **options) }
|
13
13
|
|
14
14
|
it 'is expected to be initialized' do
|
15
15
|
expect(klass).to receive(:new).with(anykey: anykey).and_return(99)
|
@@ -20,7 +20,7 @@ RSpec.describe WorkerKiller::Middleware do
|
|
20
20
|
|
21
21
|
describe WorkerKiller::Middleware::RequestsLimiter do
|
22
22
|
let(:options){ { killer: killer, min: 3, max: 3 } }
|
23
|
-
subject{ described_class.new(app, options) }
|
23
|
+
subject{ described_class.new(app, **options) }
|
24
24
|
|
25
25
|
it 'is expected to be initialized without reaction' do
|
26
26
|
expect(WorkerKiller::CountLimiter).to receive(:new).with(min: 3, max: 3).and_call_original
|
@@ -51,7 +51,7 @@ RSpec.describe WorkerKiller::Middleware do
|
|
51
51
|
|
52
52
|
describe WorkerKiller::Middleware::OOMLimiter do
|
53
53
|
let(:options){ { killer: killer, min: 2222, max: 2223 } }
|
54
|
-
subject{ described_class.new(app, options) }
|
54
|
+
subject{ described_class.new(app, **options) }
|
55
55
|
|
56
56
|
it 'is expected to be initialized without reaction' do
|
57
57
|
expect(WorkerKiller::MemoryLimiter).to receive(:new).with(min: 2222, max: 2223).and_call_original
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: worker_killer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.1.
|
4
|
+
version: 1.0.1.83603
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samoilenko Yuri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: get_process_mem
|