sidekiq-redeploy 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/sidekiq/redeploy/loader.rb +11 -12
- data/lib/sidekiq/redeploy/version.rb +1 -1
- data/sidekiq-redeploy.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49eb0b9481aa541611a9b46422e678d965156dbd892f72f8b381d0675523abf8
|
4
|
+
data.tar.gz: 828aca4be4760f584ae5fdc78bfeda3e8071dcdf34d2eba031dff052a40333a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b10b24436213050537dfd25e4ff823e5893f011940059ba3c1659c1f5f9c143d5a699e0678feb2fbeca5c92ba3435172dd15826fc07f50d927bb0bf7a511efef
|
7
|
+
data.tar.gz: 20ea11e09f85c2e16939f26f68cd16c7c667e591270334f640d067b746c5bb941079f586966c2ffe4ac476d2299a2a905a145e1bf6ae6755ce53de999c94b8d1
|
data/CHANGELOG.md
CHANGED
@@ -20,7 +20,7 @@ module Sidekiq
|
|
20
20
|
|
21
21
|
@reload_sidekiq = false
|
22
22
|
@exit_loader = false
|
23
|
-
@loader_pid = Process.pid
|
23
|
+
@loader_pid = ::Process.pid
|
24
24
|
@logger = logger
|
25
25
|
@signal_delay = config[:signal_delay] || 1
|
26
26
|
@watch_delay = config[:watch_delay] || 30
|
@@ -40,14 +40,14 @@ module Sidekiq
|
|
40
40
|
process_loop
|
41
41
|
|
42
42
|
log 'Waiting for Sidekiq process to end'
|
43
|
-
Process.waitall
|
43
|
+
::Process.waitall
|
44
44
|
|
45
45
|
log 'Shutting down sidekiq reloader'
|
46
46
|
rescue StandardError => e
|
47
47
|
log "Error in sidekiq loader: #{e.message}"
|
48
48
|
log e.backtrace.join("\n")
|
49
49
|
stop_sidekiq(@sidekiq_pid)
|
50
|
-
Process.waitall
|
50
|
+
::Process.waitall
|
51
51
|
exit 1
|
52
52
|
end
|
53
53
|
|
@@ -76,7 +76,6 @@ module Sidekiq
|
|
76
76
|
return false unless (Time.now - @watch_time) > @watch_delay
|
77
77
|
|
78
78
|
@watch_time = Time.now
|
79
|
-
log 'Checking watch file for redeploy'
|
80
79
|
deployer.needs_redeploy?
|
81
80
|
end
|
82
81
|
|
@@ -88,14 +87,14 @@ module Sidekiq
|
|
88
87
|
stop_sidekiq(@sidekiq_pid)
|
89
88
|
|
90
89
|
# wait for sidekiq to stop
|
91
|
-
Process.waitall
|
90
|
+
::Process.waitall
|
92
91
|
|
93
92
|
fork_sidekiq
|
94
93
|
@reload_sidekiq = false
|
95
94
|
end
|
96
95
|
|
97
96
|
def fork_sidekiq
|
98
|
-
@sidekiq_pid = Process.fork do
|
97
|
+
@sidekiq_pid = ::Process.fork do
|
99
98
|
cli = Sidekiq::CLI.instance
|
100
99
|
args = @sidekiq_app ? ['-r', @sidekiq_app] : []
|
101
100
|
cli.parse(args)
|
@@ -121,36 +120,36 @@ module Sidekiq
|
|
121
120
|
def handle_signal(signal)
|
122
121
|
debug_handler(signal)
|
123
122
|
# Our handle_signal gets called for child processes (i.e. sidekiq process) so we don't want to re-handle these.
|
124
|
-
return if @loader_pid != Process.pid
|
123
|
+
return if @loader_pid != ::Process.pid
|
125
124
|
|
126
125
|
case signal
|
127
126
|
when USR2
|
128
127
|
@reload_sidekiq = true
|
129
128
|
when TTIN
|
130
|
-
Process.kill(signal, @sidekiq_pid)
|
129
|
+
::Process.kill(signal, @sidekiq_pid)
|
131
130
|
when TERM, INT
|
132
131
|
@exit_loader = true
|
133
132
|
end
|
134
133
|
end
|
135
134
|
|
136
135
|
def debug_handler(signal)
|
137
|
-
log_data = { signal:, current_pid: Process.pid, loader_pid: @loader_pid, sidekiq_pid: @sidekiq_pid,
|
136
|
+
log_data = { signal:, current_pid: ::Process.pid, loader_pid: @loader_pid, sidekiq_pid: @sidekiq_pid,
|
138
137
|
reload_sidekiq: @reload_sidekiq, exit_loader: @exit_loader }
|
139
138
|
puts "handle_signal called with #{log_data}"
|
140
139
|
end
|
141
140
|
|
142
141
|
def stop_sidekiq(pid)
|
143
|
-
Process.kill(TERM, pid) if pid
|
142
|
+
::Process.kill(TERM, pid) if pid
|
144
143
|
end
|
145
144
|
|
146
145
|
def quiet_sidekiq(pid)
|
147
|
-
Process.kill(TSTP, pid) if pid
|
146
|
+
::Process.kill(TSTP, pid) if pid
|
148
147
|
end
|
149
148
|
|
150
149
|
def process_died?(pid)
|
151
150
|
return false if @exit_loader
|
152
151
|
|
153
|
-
|
152
|
+
!::Process.getpgid(pid)
|
154
153
|
rescue StandardError
|
155
154
|
true
|
156
155
|
end
|
data/sidekiq-redeploy.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.bindir = 'bin'
|
33
33
|
spec.require_paths = ['lib']
|
34
34
|
|
35
|
-
spec.add_dependency 'puma-redeploy', '~> 0.3.
|
35
|
+
spec.add_dependency 'puma-redeploy', '~> 0.3.2'
|
36
36
|
spec.add_dependency 'sidekiq', '~> 6.0'
|
37
37
|
|
38
38
|
spec.metadata['rubygems_mfa_required'] = 'true'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-redeploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tbeauvais
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: puma-redeploy
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.3.
|
19
|
+
version: 0.3.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.3.
|
26
|
+
version: 0.3.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sidekiq
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|