sidekiq-kubernetes-probes 0.3.0 → 1.0.0

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: 46b418a389b3c155add56376d6af858507ccb684849ff1ea968a8efa3de15eef
4
- data.tar.gz: 1d7680a5835f93a62ce086be226a734f3b7198cd8899d6be1db4b6ce8e8e01bf
3
+ metadata.gz: d2c2fcf533de1fc797f3223e1aad3a01501e2305d0a846b38c809876a07c70cd
4
+ data.tar.gz: b580dfbade230441b11463b5108914904b149ba4b664caa071bafb515e823210
5
5
  SHA512:
6
- metadata.gz: 282f59e08a8b890f157e52bec4a02ab7d325415e828e4f7d07625c5de60d54ef6c11c859dc5d48f48e412cab85fbc834c3447f7acb7399eac9839266ca80c033
7
- data.tar.gz: 8ac2fb2b5dc49a821f1a99722d0f3546d859db69ae4227eac7255bd4d47580b3318cd4be672804922053c6e5755bbc2d1bb6980ed69659e9d5a7b857d3276bce
6
+ metadata.gz: fa224a768df79c8f5aab59f3294cddeac2fe1f8406824d0e991eeff0f995dd8f02d1dc75ea8c81ff1b9e3159b1ad78b8ff6b4690b9249890b68de31b2bb1d887
7
+ data.tar.gz: 02a69aa5d973c3ec0372341e7dffaf4af222943ce34d8414495f39fb0950fd5d6c4195f2c970f56981aa6876488ae74fd02c6cc9f65a444d0962e05dce89aa13
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sidekiq-kubernetes-probes (0.3.0)
4
+ sidekiq-kubernetes-probes (1.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -4,7 +4,7 @@ set -e
4
4
 
5
5
  FILE="${1:-tmp/sidekiq_health}"
6
6
 
7
- INTERVAL=${SIDEKIQ_HEARTBEAT_INTERVAL:-5}
7
+ INTERVAL=${SIDEKIQ_HEARTBEAT_INTERVAL:-10}
8
8
 
9
9
  if test -f "$FILE"; then
10
10
  if [ "$(( $(date +"%s") - $(date -r $FILE +%s) ))" -gt "$INTERVAL" ]; then
@@ -0,0 +1,12 @@
1
+ module Sidekiq
2
+ class Launcher
3
+ private
4
+
5
+ alias original_beat beat
6
+
7
+ def beat
8
+ FileUtils.touch(File.join(Dir.getwd, "tmp", "sidekiq_health"))
9
+ original_beat
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module Sidekiq
2
+ class Launcher
3
+ private
4
+
5
+ alias original_heartbeat heartbeat
6
+
7
+ def heartbeat
8
+ FileUtils.touch(File.join(Dir.getwd, "tmp", "sidekiq_health"))
9
+ original_heartbeat
10
+ end
11
+ end
12
+ end
@@ -1,7 +1,7 @@
1
1
  module Sidekiq
2
2
  module Kubernetes
3
3
  module Probes
4
- VERSION = "0.3.0"
4
+ VERSION = "1.0.0"
5
5
  end
6
6
  end
7
7
  end
@@ -4,24 +4,11 @@ require "sidekiq/launcher"
4
4
 
5
5
  class SidekiqNotLoadedError < StandardError; end
6
6
 
7
- unless Sidekiq::Launcher.private_instance_methods.include?(:heartbeat)
7
+ if Sidekiq::Launcher.private_instance_methods.include?(:heartbeat)
8
+ require "sidekiq/kubernetes/probes/patch_heartbeat"
9
+ elsif Sidekiq::Launcher.private_instance_methods.include?(:beat)
10
+ require "sidekiq/kubernetes/probes/patch_beat"
11
+ else
8
12
  raise SidekiqNotLoadedError, "[sidekiq-kubernetes-probes] I'm not compatible with this version of sidekiq. " \
9
- "Because Sidekiq::Launcher does not respond to the heartbeat method"
10
- end
11
-
12
- module Sidekiq
13
- class Launcher
14
- private
15
-
16
- alias original_heartbeat heartbeat
17
-
18
- def heartbeat
19
- FileUtils.touch(File.join(root, "tmp", "sidekiq_health"))
20
- original_heartbeat
21
- end
22
-
23
- def root
24
- Dir.getwd
25
- end
26
- end
13
+ "Because Sidekiq::Launcher does not implement the heartbeat or beat private method"
27
14
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
 
19
19
  # Specify which files should be added to the gem when it is released.
20
20
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
21
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
21
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
22
22
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
23
23
  end
24
24
  spec.require_paths = ["lib"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-kubernetes-probes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micke Lisinge
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-25 00:00:00.000000000 Z
11
+ date: 2022-12-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Kubernetes probes for sidekiq
14
14
  email:
@@ -27,6 +27,8 @@ files:
27
27
  - bin/setup
28
28
  - bin/sidekiq_health_check
29
29
  - lib/sidekiq/kubernetes/probes.rb
30
+ - lib/sidekiq/kubernetes/probes/patch_beat.rb
31
+ - lib/sidekiq/kubernetes/probes/patch_heartbeat.rb
30
32
  - lib/sidekiq/kubernetes/probes/version.rb
31
33
  - sidekiq-kubernetes-probes.gemspec
32
34
  homepage: https://github.com/apoex/sidekiq-kubernetes-probes
@@ -51,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
53
  - !ruby/object:Gem::Version
52
54
  version: '0'
53
55
  requirements: []
54
- rubygems_version: 3.1.4
56
+ rubygems_version: 3.3.26
55
57
  signing_key:
56
58
  specification_version: 4
57
59
  summary: Kubernetes probes for sidekiq