resque-multi-job-forks 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -43,6 +43,7 @@ module Resque
|
|
43
43
|
Resque.after_fork, Resque.before_fork = *@suppressed_fork_hooks
|
44
44
|
@release_fork_limit = @jobs_processed = @cant_fork = nil
|
45
45
|
log 'hijack over, counter terrorists win.'
|
46
|
+
@shutdown = true unless $TESTING
|
46
47
|
end
|
47
48
|
|
48
49
|
def fork_job_limit
|
@@ -84,4 +85,4 @@ module Resque
|
|
84
85
|
@before_child_exit = before_child_exit
|
85
86
|
end
|
86
87
|
|
87
|
-
end
|
88
|
+
end
|
@@ -10,18 +10,18 @@ class TestResqueMultiJobForks < Test::Unit::TestCase
|
|
10
10
|
def test_timeout_limit_sequence_of_events
|
11
11
|
# only allow enough time for 3 jobs to process.
|
12
12
|
@worker.seconds_per_fork = 3
|
13
|
-
|
13
|
+
|
14
14
|
Resque.enqueue(SequenceJob, 1)
|
15
15
|
Resque.enqueue(SequenceJob, 2)
|
16
16
|
Resque.enqueue(SequenceJob, 3)
|
17
17
|
Resque.enqueue(SequenceJob, 4)
|
18
|
-
|
18
|
+
|
19
19
|
# make sure we don't take longer then 15 seconds.
|
20
20
|
begin
|
21
21
|
Timeout::timeout(15) { @worker.work(1) }
|
22
22
|
rescue Timeout::Error
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
# test the sequence is correct.
|
26
26
|
assert_equal([:before_fork, :after_fork, :work_1, :work_2, :work_3,
|
27
27
|
:before_child_exit_3, :before_fork, :after_fork, :work_4,
|
@@ -50,7 +50,7 @@ class TestResqueMultiJobForks < Test::Unit::TestCase
|
|
50
50
|
assert_equal :work_40, $SEQUENCE[44], '40th chunk of work.'
|
51
51
|
assert_equal :before_child_exit_20, $SEQUENCE[45], 'final before_child_exit call.'
|
52
52
|
end
|
53
|
-
|
53
|
+
|
54
54
|
def teardown
|
55
55
|
# make sure we don't clobber any other tests.
|
56
56
|
ENV['JOBS_PER_FORK'] = nil
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-multi-job-forks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 1
|
10
|
+
version: 0.3.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Mick Staugaard
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-12-
|
19
|
+
date: 2010-12-29 00:00:00 +01:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|