resque-multi-job-forks 0.5.1 → 0.5.2

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: cd2a600dbcd1f57dcee123b6cb34f055f170bf9ef8eb1a114ded55841bd99149
4
- data.tar.gz: 80a3ffe7e7f626fb77e11487b51faa129a13a60382944d3c5c15e8c60b942c9e
3
+ metadata.gz: 2b710d8dc861eb050596364959ae65da3f099c29492370d3a817239428cf5a38
4
+ data.tar.gz: 45b5e45ddf6aac1a092b5d9047483ad4b9d4064920d5f875f8251686310e2d46
5
5
  SHA512:
6
- metadata.gz: 1184ff5df61cebf795557a9e93b43be059a6bf1671ab7362a89400dcb2b7d97658e9f06735adf0d7c3a3f9cab57addc755232904ec0dff251106e71e116ffc5c
7
- data.tar.gz: e6e76c24c2c2d591cc6c944ab3e8a9ef57ab67510ef1454b78a7e4704c9876fd78e1c44ebf52f47a0404254796728730757b1e5f89ce7e7cdd0c0a06bd93416b
6
+ metadata.gz: 2d98283d9a0b31141e943d452cf786781c5b6e3e42dbacc2a7175a41e8f4380bc85914570215111c1a088ed16e6f9d08855cba454ca943e75eac09694f0d8da2
7
+ data.tar.gz: 6199e71957234fe7c374778ddb28e56207e9c438750eb2051852f0bd150cb89304c587351e007d76eb680ed0a09c42fcb6e52ef0f7f3c99eaae84e9e2a7d06a4
@@ -91,7 +91,7 @@ module Resque
91
91
  def shutdown_child
92
92
  return unless @child
93
93
  begin
94
- log! "multi_jobs_per_fork: Sending QUIT signal to #{@child}"
94
+ log_with_severity :debug, "multi_jobs_per_fork: Sending QUIT signal to #{@child}"
95
95
  Process.kill('QUIT', @child)
96
96
  rescue Errno::ESRCH
97
97
  nil
@@ -112,7 +112,7 @@ module Resque
112
112
  end
113
113
 
114
114
  def hijack_fork
115
- log 'hijack fork.'
115
+ log_with_severity :debug, 'hijack fork.'
116
116
  @suppressed_fork_hooks = [Resque.after_fork, Resque.before_fork]
117
117
  Resque.after_fork = Resque.before_fork = nil
118
118
  @release_fork_limit = fork_job_limit
@@ -121,11 +121,11 @@ module Resque
121
121
  end
122
122
 
123
123
  def release_fork
124
- log "jobs processed by child: #{jobs_processed}; rss: #{rss}"
124
+ log_with_severity :info, "jobs processed by child: #{jobs_processed}; rss: #{rss}"
125
125
  run_hook :before_child_exit, self
126
126
  Resque.after_fork, Resque.before_fork = *@suppressed_fork_hooks
127
127
  @release_fork_limit = @jobs_processed = nil
128
- log 'hijack over, counter terrorists win.'
128
+ log_with_severity :debug, 'hijack over, counter terrorists win.'
129
129
  @shutdown = true
130
130
  end
131
131
 
data/test/helper.rb CHANGED
@@ -27,14 +27,6 @@ module Resque
27
27
  end
28
28
  end
29
29
 
30
- def log(message)
31
- log_with_severity :info, message
32
- end
33
-
34
- def log!(message)
35
- log_with_severity :debug, message
36
- end
37
-
38
30
  end
39
31
  end
40
32
 
@@ -8,7 +8,7 @@ class TestResqueMultiJobForks < Test::Unit::TestCase
8
8
  end
9
9
 
10
10
  def test_timeout_limit_sequence_of_events
11
- @worker.log! "in test_timeout_limit_sequence_of_events"
11
+ @worker.log_with_severity :debug, "in test_timeout_limit_sequence_of_events"
12
12
  # only allow enough time for 3 jobs to process.
13
13
  @worker.seconds_per_fork = 3
14
14
 
@@ -29,7 +29,7 @@ class TestResqueMultiJobForks < Test::Unit::TestCase
29
29
  end
30
30
 
31
31
  def test_graceful_shutdown_during_first_job
32
- @worker.log! "in test_graceful_shutdown_during_first_job"
32
+ @worker.log_with_severity :debug, "in test_graceful_shutdown_during_first_job"
33
33
  # enough time for all jobs to process.
34
34
  @worker.seconds_per_fork = 60
35
35
 
@@ -51,7 +51,7 @@ class TestResqueMultiJobForks < Test::Unit::TestCase
51
51
  end
52
52
 
53
53
  def test_immediate_shutdown_during_first_job
54
- @worker.log! "in test_immediate_shutdown_during_first_job"
54
+ @worker.log_with_severity :debug, "in test_immediate_shutdown_during_first_job"
55
55
  # enough time for all jobs to process.
56
56
  @worker.seconds_per_fork = 60
57
57
  @worker.term_child = false
@@ -73,7 +73,7 @@ class TestResqueMultiJobForks < Test::Unit::TestCase
73
73
  end
74
74
 
75
75
  def test_sigterm_shutdown_during_first_job
76
- @worker.log! "in test_sigterm_shutdown_during_first_job"
76
+ @worker.log_with_severity :debug, "in test_sigterm_shutdown_during_first_job"
77
77
  # enough time for all jobs to process.
78
78
  @worker.seconds_per_fork = 60
79
79
  @worker.term_child = true
@@ -98,7 +98,7 @@ class TestResqueMultiJobForks < Test::Unit::TestCase
98
98
 
99
99
  # test we can also limit fork job process by a job limit.
100
100
  def test_job_limit_sequence_of_events
101
- @worker.log! "in test_job_limit_sequence_of_events"
101
+ @worker.log_with_severity :debug, "in test_job_limit_sequence_of_events"
102
102
  # only allow 20 jobs per fork
103
103
  ENV['JOBS_PER_FORK'] = '20'
104
104
 
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.1
4
+ version: 0.5.2
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-05-23 00:00:00.000000000 Z
13
+ date: 2021-03-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: resque
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  requirements: []
124
- rubygems_version: 3.0.3
124
+ rubygems_version: 3.1.4
125
125
  signing_key:
126
126
  specification_version: 4
127
127
  summary: Have your resque workers process more that one job