resque-heroku-signals 2.5.0 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +1 -1
- data/lib/resque-heroku-signals.rb +30 -11
- data/resque-heroku-signals.gemspec +2 -2
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '084c40afbbe574362fe885154b1445197c593d7fada8332a1d5b544c57ec0350'
|
4
|
+
data.tar.gz: 39cb127ffa94809de2abb47cad2c1ea836f0d524dc3b3f9a7b1a7aafb8631add
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c11a2d70a3c2f6cef8f0f593ffbf63e2cb683f49ada10c521c86a1dcde80956c7a3037ba401ce984d7d9b8b41e2b2d6e2348a56619d10af7a400b7ad61cb3d8
|
7
|
+
data.tar.gz: fe6f9b45760f34aeecd7f424d3a3b45d3150398781e552b34b3a576fe9c2b4ff1eba2bc7accc34963b801e2bb3e7cb40fdafb1985864109609f2e38132d5213f
|
data/.github/workflows/ci.yml
CHANGED
@@ -12,24 +12,43 @@ end
|
|
12
12
|
# https://github.com/resque/resque/blame/v2.0.0/lib/resque/worker.rb#L406
|
13
13
|
# https://github.com/resque/resque/issues/1559#issuecomment-310908574
|
14
14
|
Resque::Worker.class_eval do
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
# In this patched implementation, the only change is that the worker sends
|
16
|
+
# SIGINT to the child, the rest is copied verbatim.
|
17
|
+
def new_kill_child
|
18
|
+
if @child
|
19
|
+
unless child_already_exited?
|
20
|
+
if pre_shutdown_timeout && pre_shutdown_timeout > 0.0
|
21
|
+
log_with_severity :debug, "Waiting #{pre_shutdown_timeout.to_f}s for child process to exit"
|
22
|
+
return if wait_for_child_exit(pre_shutdown_timeout)
|
23
|
+
end
|
18
24
|
|
19
|
-
|
20
|
-
|
25
|
+
log_with_severity :debug, "Sending INT signal to child #{@child}"
|
26
|
+
Process.kill("INT", @child)
|
21
27
|
|
22
|
-
|
23
|
-
|
28
|
+
if wait_for_child_exit(term_timeout)
|
29
|
+
return
|
30
|
+
else
|
31
|
+
log_with_severity :debug, "Sending KILL signal to child #{@child}"
|
32
|
+
Process.kill("KILL", @child)
|
24
33
|
end
|
25
|
-
|
26
|
-
|
34
|
+
else
|
35
|
+
log_with_severity :debug, "Child #{@child} already quit."
|
27
36
|
end
|
37
|
+
end
|
38
|
+
rescue SystemCallError
|
39
|
+
log_with_severity :error, "Child #{@child} already quit and reaped."
|
40
|
+
end
|
28
41
|
|
29
|
-
|
42
|
+
def unregister_signal_handlers
|
43
|
+
trap("TERM") do
|
44
|
+
log_with_severity :debug, "Got TERM signal from Heroku."
|
45
|
+
$HEROKU_WILL_TERMINATE_RESQUE = true
|
30
46
|
end
|
31
47
|
|
32
|
-
trap(
|
48
|
+
trap("INT") do
|
49
|
+
log_with_severity :debug, "Got INT signal from the worker."
|
50
|
+
raise Resque::TermException.new("SIGINT")
|
51
|
+
end
|
33
52
|
|
34
53
|
begin
|
35
54
|
trap('QUIT', 'DEFAULT')
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "resque-heroku-signals"
|
7
|
-
spec.version = '2.
|
7
|
+
spec.version = '2.6.0'
|
8
8
|
spec.authors = ["Michael Bianco"]
|
9
9
|
spec.email = ["mike@mikebian.co"]
|
10
10
|
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.metadata['rubygems_mfa_required'] = 'true'
|
23
23
|
|
24
24
|
# strict resque dependency is intentional
|
25
|
-
spec.add_dependency "resque", "2.
|
25
|
+
spec.add_dependency "resque", "2.6.0"
|
26
26
|
|
27
27
|
spec.add_development_dependency "bundler", "~> 2.2"
|
28
28
|
spec.add_development_dependency "rake", "~> 13.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-heroku-signals
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Bianco
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: resque
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.6.0
|
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: 2.
|
26
|
+
version: 2.6.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '3.10'
|
69
|
-
description:
|
69
|
+
description:
|
70
70
|
email:
|
71
71
|
- mike@mikebian.co
|
72
72
|
executables: []
|
@@ -92,7 +92,7 @@ licenses:
|
|
92
92
|
- MIT
|
93
93
|
metadata:
|
94
94
|
rubygems_mfa_required: 'true'
|
95
|
-
post_install_message:
|
95
|
+
post_install_message:
|
96
96
|
rdoc_options: []
|
97
97
|
require_paths:
|
98
98
|
- lib
|
@@ -107,8 +107,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
|
-
rubygems_version: 3.4.
|
111
|
-
signing_key:
|
110
|
+
rubygems_version: 3.4.10
|
111
|
+
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Patch resque to be compatible with Heroku
|
114
114
|
test_files: []
|