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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d105384fd7ef69a92ab40d8b9d1f68dda9caf93e81408b9ee810b103e49ba146
4
- data.tar.gz: cf879748d242a491aa7d9183e592dd05b6504766fc9ab0c6a6c7f3d4caf94770
3
+ metadata.gz: f8056e7c8b67a8b90cd8482050e68229bb36ef9c9097e61d625dc786ef76e208
4
+ data.tar.gz: 6f12abb37fbaf995583c9ecf3620178b03ff94b90678a2acb747fdf393457d77
5
5
  SHA512:
6
- metadata.gz: 6f4abfe5fea9491e1c7c89d7b07b01a6d8cf0871cf381b86ce1cf6b75ae48331b21da9c3442564e1696e3d5b2664744ed5d0e2f1128ed3b42776a6e1cd6ffe88
7
- data.tar.gz: 02c405793d6197e95401e4324968bd15af4410634e9be6df91a3fc30a9d278837e3e1795fd6f74af21c7e85b000eee0c98d7aa746c54853b515eff1cd4948a41
6
+ metadata.gz: df44813409d2866fb2a6d9b03452cba24b995cedc72a201dd58d71fdf619dc9854614751c2721af39aa66f10ee2a0e62819b428e12112c052fcf5a011808edb9
7
+ data.tar.gz: c8ee7ae0c4d1e1bb03c065b0fecd1f25b853f58eb859213dcd367660413b9c81426ee6df928bc716ee767551d7480365c7c060a3a1d05c75ac5708c807ba8a4e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## v0.1.5
2
+
3
+ **Fixes and enhancements:**
4
+
5
+ - Fix Process namespace collision with Sidekiq::Process
6
+
7
+ ## v0.1.4
8
+
9
+ **Fixes and enhancements:**
10
+
11
+ - Fix missing require
12
+
1
13
  ## v0.1.3
2
14
 
3
15
  **Fixes and enhancements:**
data/bin/sidekiq-loader CHANGED
@@ -4,6 +4,7 @@
4
4
  require 'bundler/setup'
5
5
  require 'sidekiq-redeploy'
6
6
  require 'puma-redeploy'
7
+ require 'optparse'
7
8
 
8
9
  def run_sidekiq(ops, logger)
9
10
  deployer = Puma::Redeploy::DeployerFactory.create(target: ops[:app_dir], watch_file: ops[:watch], logger:)
@@ -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
- !Process.getpgid(pid)
153
+ !::Process.getpgid(pid)
154
154
  rescue StandardError
155
155
  true
156
156
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sidekiq
4
4
  module Redeploy
5
- VERSION = '0.1.3'
5
+ VERSION = '0.1.5'
6
6
  end
7
7
  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.3
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-22 00:00:00.000000000 Z
11
+ date: 2023-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puma-redeploy