resque-multi-job-forks 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 2bd1e8435173c27eefcab09cdc99cba876698404
4
- data.tar.gz: 96f8db0967c05a3104fc48e78fa49f5a0c5c4e79
2
+ SHA256:
3
+ metadata.gz: cd2a600dbcd1f57dcee123b6cb34f055f170bf9ef8eb1a114ded55841bd99149
4
+ data.tar.gz: 80a3ffe7e7f626fb77e11487b51faa129a13a60382944d3c5c15e8c60b942c9e
5
5
  SHA512:
6
- metadata.gz: 91ffc7a44dcb0353754bcc96410ed3d4c4701d3176427dfa8b626d5b6a3af3eb1ce3a1d5e8a6f5d39809e661de98121ba39d6d08fd17b5d550adb0731312fb44
7
- data.tar.gz: 8bca3021d289308c02d199e30a7dea8551ca8103783effe134ab71dc641894ebd4ae727320a5551e3611357f786db2cb84a65872e74bf0130937d67735da4cae
6
+ metadata.gz: 1184ff5df61cebf795557a9e93b43be059a6bf1671ab7362a89400dcb2b7d97658e9f06735adf0d7c3a3f9cab57addc755232904ec0dff251106e71e116ffc5c
7
+ data.tar.gz: e6e76c24c2c2d591cc6c944ab3e8a9ef57ab67510ef1454b78a7e4704c9876fd78e1c44ebf52f47a0404254796728730757b1e5f89ce7e7cdd0c0a06bd93416b
@@ -54,14 +54,14 @@ module Resque
54
54
  alias_method :shutdown?, :shutdown_with_multi_job_forks?
55
55
 
56
56
  def shutdown_with_multi_job_forks
57
- shutdown_child if is_parent_process?
57
+ shutdown_child
58
58
  shutdown_without_multi_job_forks
59
59
  end
60
60
  alias_method :shutdown_without_multi_job_forks, :shutdown
61
61
  alias_method :shutdown, :shutdown_with_multi_job_forks
62
62
 
63
63
  def pause_processing_with_multi_job_forks
64
- shutdown_child if is_parent_process?
64
+ shutdown_child
65
65
  pause_processing_without_multi_job_forks
66
66
  end
67
67
  alias_method :pause_processing_without_multi_job_forks, :pause_processing
@@ -89,6 +89,7 @@ module Resque
89
89
  # multiple jobs per fork. The QUIT signal normally does a graceful shutdown,
90
90
  # and is re-registered in children (term_child normally unregisters it).
91
91
  def shutdown_child
92
+ return unless @child
92
93
  begin
93
94
  log! "multi_jobs_per_fork: Sending QUIT signal to #{@child}"
94
95
  Process.kill('QUIT', @child)
@@ -169,16 +170,11 @@ module Resque
169
170
  # Call with a block to set the hook.
170
171
  # Call with no arguments to return the hook.
171
172
  def self.before_child_exit(&block)
172
- if block
173
- @before_child_exit ||= []
174
- @before_child_exit << block
175
- end
176
- @before_child_exit
173
+ block ? register_hook(:before_child_exit, block) : hooks(:before_child_exit)
177
174
  end
178
175
 
179
176
  # Set the before_child_exit proc.
180
177
  def self.before_child_exit=(before_child_exit)
181
- @before_child_exit = before_child_exit.respond_to?(:each) ? before_child_exit : [before_child_exit].compact
178
+ register_hook(:before_child_exit, block)
182
179
  end
183
-
184
180
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-multi-job-forks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mick Staugaard
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-02-10 00:00:00.000000000 Z
13
+ date: 2019-05-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: resque
@@ -121,8 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  requirements: []
124
- rubyforge_project:
125
- rubygems_version: 2.6.14.3
124
+ rubygems_version: 3.0.3
126
125
  signing_key:
127
126
  specification_version: 4
128
127
  summary: Have your resque workers process more that one job