sidekiq_alive 2.1.0 → 2.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +48 -0
- data/.github/workflows/test.yml +41 -0
- data/.tool-versions +1 -1
- data/.travis.yml +2 -0
- data/Gemfile.lock +4 -2
- data/README.md +1 -1
- data/docker-compose.yml +1 -0
- data/lib/sidekiq_alive/config.rb +4 -4
- data/lib/sidekiq_alive/server.rb +1 -1
- data/lib/sidekiq_alive/version.rb +1 -1
- data/lib/sidekiq_alive.rb +9 -2
- data/sidekiq_alive.gemspec +2 -1
- metadata +24 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45d77df41c90efdbcb9ef9c1faa749cfeca83725eddf9d91714ff537faaa7348
|
4
|
+
data.tar.gz: f74f776df3b92e098b8b6178e3a114056d9d09fe975d42062ed8dd91d17ec4db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c0074d76de89030184eac7463a7227aeacb767c54d89a34e1cbb80253342a3378fcfec07cf91f04bba5a91cf4aec4b8608b992c4c83d3379fdb78bee45312be
|
7
|
+
data.tar.gz: 68a46cb3ed64998666966b8d45ae0d424946899877ae25367ec855d0e150b2b5a91e153af79cfa0d6fd78a92a25fcdd666674e8fa53138c81306a4547766cd51
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [master]
|
13
|
+
pull_request:
|
14
|
+
branches: [master]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
runs-on: ubuntu-latest
|
19
|
+
strategy:
|
20
|
+
matrix:
|
21
|
+
ruby-version: ["2.6", "2.7", "3.0"]
|
22
|
+
services:
|
23
|
+
# Label used to access the service container
|
24
|
+
redis:
|
25
|
+
# Docker Hub image
|
26
|
+
image: redis
|
27
|
+
# Set health checks to wait until redis has started
|
28
|
+
options: >-
|
29
|
+
--health-cmd "redis-cli ping"
|
30
|
+
--health-interval 10s
|
31
|
+
--health-timeout 5s
|
32
|
+
--health-retries 5
|
33
|
+
ports:
|
34
|
+
# Maps port 6379 on service container to the host
|
35
|
+
- 6379:6379
|
36
|
+
|
37
|
+
steps:
|
38
|
+
- uses: actions/checkout@v2
|
39
|
+
- name: Set up Ruby
|
40
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
41
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
42
|
+
# uses: ruby/setup-ruby@v1
|
43
|
+
uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
|
44
|
+
with:
|
45
|
+
ruby-version: ${{ matrix.ruby-version }}
|
46
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
47
|
+
- name: Run tests
|
48
|
+
run: bundle exec rake
|
@@ -0,0 +1,41 @@
|
|
1
|
+
name: Ruby CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [main]
|
6
|
+
pull_request:
|
7
|
+
branches: [main]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
|
13
|
+
strategy:
|
14
|
+
matrix:
|
15
|
+
ruby-version: [3.0.x, 2.7.x, 2.6.x, 2.5.x]
|
16
|
+
# Service containers to run with `runner-job`
|
17
|
+
services:
|
18
|
+
# Label used to access the service container
|
19
|
+
redis:
|
20
|
+
# Docker Hub image
|
21
|
+
image: redis
|
22
|
+
# Set health checks to wait until redis has started
|
23
|
+
options: >-
|
24
|
+
--health-cmd "redis-cli ping"
|
25
|
+
--health-interval 10s
|
26
|
+
--health-timeout 5s
|
27
|
+
--health-retries 5
|
28
|
+
ports:
|
29
|
+
# Maps port 6379 on service container to the host
|
30
|
+
- 6379:6379
|
31
|
+
|
32
|
+
steps:
|
33
|
+
- uses: actions/checkout@v2
|
34
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
35
|
+
uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
|
36
|
+
with:
|
37
|
+
ruby-version: ${{ matrix.ruby-version }}
|
38
|
+
- name: Install dependencies
|
39
|
+
run: bundle install
|
40
|
+
- name: Run tests
|
41
|
+
run: bundle exec rspec
|
data/.tool-versions
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby
|
1
|
+
ruby 3.0.2
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sidekiq_alive (2.
|
4
|
+
sidekiq_alive (2.1.4)
|
5
5
|
sidekiq
|
6
|
+
webrick
|
6
7
|
|
7
8
|
GEM
|
8
9
|
remote: https://rubygems.org/
|
@@ -43,12 +44,13 @@ GEM
|
|
43
44
|
rack (>= 1.5.0)
|
44
45
|
rack-protection (>= 1.5.0)
|
45
46
|
redis (>= 3.3.5, < 5)
|
47
|
+
webrick (1.7.0)
|
46
48
|
|
47
49
|
PLATFORMS
|
48
50
|
ruby
|
49
51
|
|
50
52
|
DEPENDENCIES
|
51
|
-
bundler (
|
53
|
+
bundler (> 1.16)
|
52
54
|
mock_redis
|
53
55
|
pry
|
54
56
|
rack-test
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# SidekiqAlive
|
2
2
|
|
3
|
-
|
3
|
+
![build](https://github.com/arturictus/sidekiq_alive/actions/workflows/ruby.yml/badge.svg)
|
4
4
|
[![Maintainability](https://api.codeclimate.com/v1/badges/35c39124564ffeb0ce4e/maintainability)](https://codeclimate.com/github/arturictus/sidekiq_alive/maintainability)
|
5
5
|
[![Test Coverage](https://api.codeclimate.com/v1/badges/35c39124564ffeb0ce4e/test_coverage)](https://codeclimate.com/github/arturictus/sidekiq_alive/test_coverage)
|
6
6
|
|
data/docker-compose.yml
CHANGED
data/lib/sidekiq_alive/config.rb
CHANGED
@@ -20,15 +20,15 @@ module SidekiqAlive
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def set_defaults
|
23
|
-
@host = ENV
|
24
|
-
@port = ENV
|
25
|
-
@path = ENV
|
23
|
+
@host = ENV.fetch('SIDEKIQ_ALIVE_HOST', '0.0.0.0')
|
24
|
+
@port = ENV.fetch('SIDEKIQ_ALIVE_PORT', 7433)
|
25
|
+
@path = ENV.fetch('SIDEKIQ_ALIVE_PATH', '/')
|
26
26
|
@liveness_key = 'SIDEKIQ::LIVENESS_PROBE_TIMESTAMP'
|
27
27
|
@time_to_live = 10 * 60
|
28
28
|
@callback = proc {}
|
29
29
|
@registered_instance_key = 'SIDEKIQ_REGISTERED_INSTANCE'
|
30
30
|
@queue_prefix = :sidekiq_alive
|
31
|
-
@server = ENV
|
31
|
+
@server = ENV.fetch('SIDEKIQ_ALIVE_SERVER', 'webrick')
|
32
32
|
@custom_liveness_probe = proc { true }
|
33
33
|
end
|
34
34
|
|
data/lib/sidekiq_alive/server.rb
CHANGED
data/lib/sidekiq_alive.rb
CHANGED
@@ -52,7 +52,14 @@ module SidekiqAlive
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def self.registered_instances
|
55
|
-
|
55
|
+
deep_scan("#{config.registered_instance_key}::*")
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.deep_scan(keyword, keys = [], cursor = 0)
|
59
|
+
next_cursor, found_keys = *redis { |r| r }.scan(cursor, match: keyword)
|
60
|
+
keys += found_keys
|
61
|
+
return keys if next_cursor == "0" || found_keys.blank?
|
62
|
+
deep_scan(keyword, keys, next_cursor)
|
56
63
|
end
|
57
64
|
|
58
65
|
def self.purge_pending_jobs
|
@@ -156,4 +163,4 @@ end
|
|
156
163
|
require 'sidekiq_alive/worker'
|
157
164
|
require 'sidekiq_alive/server'
|
158
165
|
|
159
|
-
SidekiqAlive.start unless ENV
|
166
|
+
SidekiqAlive.start unless ENV.fetch('DISABLE_SIDEKIQ_ALIVE', '').casecmp("true") == 0
|
data/sidekiq_alive.gemspec
CHANGED
@@ -29,11 +29,12 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
30
30
|
spec.require_paths = ['lib']
|
31
31
|
|
32
|
-
spec.add_development_dependency 'bundler', '
|
32
|
+
spec.add_development_dependency 'bundler', '> 1.16'
|
33
33
|
spec.add_development_dependency 'mock_redis'
|
34
34
|
spec.add_development_dependency 'rack-test'
|
35
35
|
spec.add_development_dependency 'rake', '~> 13.0'
|
36
36
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
37
37
|
spec.add_development_dependency 'rspec-sidekiq', '~> 3.0'
|
38
38
|
spec.add_dependency 'sidekiq'
|
39
|
+
spec.add_dependency 'webrick'
|
39
40
|
end
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq_alive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artur Pañach
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.16'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.16'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: webrick
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
description: |-
|
112
126
|
SidekiqAlive offers a solution to add liveness probe of a Sidekiq instance.
|
113
127
|
|
@@ -125,6 +139,8 @@ executables: []
|
|
125
139
|
extensions: []
|
126
140
|
extra_rdoc_files: []
|
127
141
|
files:
|
142
|
+
- ".github/workflows/ruby.yml"
|
143
|
+
- ".github/workflows/test.yml"
|
128
144
|
- ".gitignore"
|
129
145
|
- ".rspec"
|
130
146
|
- ".tool-versions"
|
@@ -148,7 +164,7 @@ homepage: https://github.com/arturictus/sidekiq_alive
|
|
148
164
|
licenses:
|
149
165
|
- MIT
|
150
166
|
metadata: {}
|
151
|
-
post_install_message:
|
167
|
+
post_install_message:
|
152
168
|
rdoc_options: []
|
153
169
|
require_paths:
|
154
170
|
- lib
|
@@ -163,8 +179,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
179
|
- !ruby/object:Gem::Version
|
164
180
|
version: '0'
|
165
181
|
requirements: []
|
166
|
-
rubygems_version: 3.
|
167
|
-
signing_key:
|
182
|
+
rubygems_version: 3.2.22
|
183
|
+
signing_key:
|
168
184
|
specification_version: 4
|
169
185
|
summary: Liveness probe for sidekiq on Kubernetes deployments.
|
170
186
|
test_files: []
|