worker_killer 1.0.1.75538 → 1.0.1.83603

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: 2c6211b790da17ea0b47bad73ee9689a2b5b77e1a5154f9463d9edce4e0afc55
4
- data.tar.gz: 2934e7d52ee80eb1ccf87478666bc57b91c869d042f593f63763287bf1a88c7f
3
+ metadata.gz: af1736e1bb8f2bfc3c3aa9e93d2fa1aa429173dc2389e7969c24210479e90441
4
+ data.tar.gz: f472d15158b29d0a920e49f873b46edcc19f554c0d3a75cfe33cf43b195ed0d6
5
5
  SHA512:
6
- metadata.gz: 4f64d4a287ec283d6f5adb1411b7bffc6272765c27e7120030597e056a825766bcbbe37746a5c9bd4d4c3e6b0392a6d72ab1984a56f6b6c9b0fbf35683dd2430
7
- data.tar.gz: 8ca469adb753f2e49936eecc8d6b893369921d644af6e04c14a4fdcf908b04ba515c2860f2b8ab10c4e3aae5c003e3fd75a3c5586b7e15a797b885da0fd4ff4f
6
+ metadata.gz: 2796b66e4f0069df66073c2acdc2cefa7c2213efdf36ddaf7a76e63cdc9bf53ffe4b369406bb8e6dd890d6f242b47f44fcd4cfde83e73b499f8d1e002097a8bd
7
+ data.tar.gz: a3d13754ae85c50564e8b825d61ec8d0397b1e664647e3b18a4423426f081b6a6bada3e26941773415856afa1e5abab8fdf04a88045beb2f2b704054f0d1517e
@@ -13,7 +13,7 @@ module WorkerKiller
13
13
  k.kill(l.started_at, dj: dj)
14
14
  end
15
15
 
16
- @limiter = klass.new(opts)
16
+ @limiter = klass.new(**opts)
17
17
  end
18
18
 
19
19
  def new(*_args)
@@ -1,5 +1,5 @@
1
1
  RSpec.describe WorkerKiller::CountLimiter do
2
- subject{ described_class.new(options) }
2
+ subject{ described_class.new(**options) }
3
3
  let(:min){ rand(50..100) }
4
4
  let(:max){ min + rand(100) }
5
5
  let(:options){ { min: min, max: max, verbose: true } }
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
- expect(killer).to receive(:do_kill).with(:QUIT, anything, anything, anything).exactly(2).times
23
- expect(killer).to receive(:do_kill).with(:TERM, anything, anything, anything).exactly(2).times
24
- expect(killer).to receive(:do_kill).with(:KILL, anything, anything, anything).exactly(5).times
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
@@ -1,7 +1,7 @@
1
1
  RSpec.describe WorkerKiller::MemoryLimiter do
2
2
  let(:logger){ Logger.new(nil) }
3
3
 
4
- subject{ described_class.new(options) }
4
+ subject{ described_class.new(**options) }
5
5
  let(:mb){ 1024 * 1024 }
6
6
  let(:min){ rand(50..100) * mb }
7
7
  let(:max){ min + rand(100) * mb }
@@ -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.75538
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-02-07 00:00:00.000000000 Z
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