sidekiq-redeploy 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/bin/sidekiq-loader +1 -0
- data/lib/sidekiq/redeploy/loader.rb +11 -11
- data/lib/sidekiq/redeploy/version.rb +1 -1
- 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: f8056e7c8b67a8b90cd8482050e68229bb36ef9c9097e61d625dc786ef76e208
|
4
|
+
data.tar.gz: 6f12abb37fbaf995583c9ecf3620178b03ff94b90678a2acb747fdf393457d77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df44813409d2866fb2a6d9b03452cba24b995cedc72a201dd58d71fdf619dc9854614751c2721af39aa66f10ee2a0e62819b428e12112c052fcf5a011808edb9
|
7
|
+
data.tar.gz: c8ee7ae0c4d1e1bb03c065b0fecd1f25b853f58eb859213dcd367660413b9c81426ee6df928bc716ee767551d7480365c7c060a3a1d05c75ac5708c807ba8a4e
|
data/CHANGELOG.md
CHANGED
data/bin/sidekiq-loader
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
|
|
@@ -88,14 +88,14 @@ module Sidekiq
|
|
88
88
|
stop_sidekiq(@sidekiq_pid)
|
89
89
|
|
90
90
|
# wait for sidekiq to stop
|
91
|
-
Process.waitall
|
91
|
+
::Process.waitall
|
92
92
|
|
93
93
|
fork_sidekiq
|
94
94
|
@reload_sidekiq = false
|
95
95
|
end
|
96
96
|
|
97
97
|
def fork_sidekiq
|
98
|
-
@sidekiq_pid = Process.fork do
|
98
|
+
@sidekiq_pid = ::Process.fork do
|
99
99
|
cli = Sidekiq::CLI.instance
|
100
100
|
args = @sidekiq_app ? ['-r', @sidekiq_app] : []
|
101
101
|
cli.parse(args)
|
@@ -121,36 +121,36 @@ module Sidekiq
|
|
121
121
|
def handle_signal(signal)
|
122
122
|
debug_handler(signal)
|
123
123
|
# 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
|
124
|
+
return if @loader_pid != ::Process.pid
|
125
125
|
|
126
126
|
case signal
|
127
127
|
when USR2
|
128
128
|
@reload_sidekiq = true
|
129
129
|
when TTIN
|
130
|
-
Process.kill(signal, @sidekiq_pid)
|
130
|
+
::Process.kill(signal, @sidekiq_pid)
|
131
131
|
when TERM, INT
|
132
132
|
@exit_loader = true
|
133
133
|
end
|
134
134
|
end
|
135
135
|
|
136
136
|
def debug_handler(signal)
|
137
|
-
log_data = { signal:, current_pid: Process.pid, loader_pid: @loader_pid, sidekiq_pid: @sidekiq_pid,
|
137
|
+
log_data = { signal:, current_pid: ::Process.pid, loader_pid: @loader_pid, sidekiq_pid: @sidekiq_pid,
|
138
138
|
reload_sidekiq: @reload_sidekiq, exit_loader: @exit_loader }
|
139
139
|
puts "handle_signal called with #{log_data}"
|
140
140
|
end
|
141
141
|
|
142
142
|
def stop_sidekiq(pid)
|
143
|
-
Process.kill(TERM, pid) if pid
|
143
|
+
::Process.kill(TERM, pid) if pid
|
144
144
|
end
|
145
145
|
|
146
146
|
def quiet_sidekiq(pid)
|
147
|
-
Process.kill(TSTP, pid) if pid
|
147
|
+
::Process.kill(TSTP, pid) if pid
|
148
148
|
end
|
149
149
|
|
150
150
|
def process_died?(pid)
|
151
151
|
return false if @exit_loader
|
152
152
|
|
153
|
-
|
153
|
+
!::Process.getpgid(pid)
|
154
154
|
rescue StandardError
|
155
155
|
true
|
156
156
|
end
|
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.5
|
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-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: puma-redeploy
|