resque-igo 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/resque/job.rb +4 -0
- data/lib/resque/version.rb +1 -1
- data/test/resque_test.rb +11 -1
- data/test/test_helper.rb +5 -0
- metadata +4 -4
data/lib/resque/job.rb
CHANGED
@@ -70,6 +70,10 @@ module Resque
|
|
70
70
|
raise QueueError.new 'trying to insert a delayed job into a non-delayed queue'
|
71
71
|
end
|
72
72
|
end
|
73
|
+
|
74
|
+
#is it a hydra job?
|
75
|
+
heads = klass.instance_variable_get(:@hydra)
|
76
|
+
queue = (queue.to_s + rand(heads).to_s).to_sym if heads
|
73
77
|
|
74
78
|
ret = Resque.push(queue, item)
|
75
79
|
Plugin.after_enqueue_hooks(klass).each do |hook|
|
data/lib/resque/version.rb
CHANGED
data/test/resque_test.rb
CHANGED
@@ -319,7 +319,7 @@ context "Resque" do
|
|
319
319
|
Resque.bypass_queues = true
|
320
320
|
args = { :delay_until => Time.new+20}
|
321
321
|
foo = Resque.enqueue(DelayedJob, args)
|
322
|
-
|
322
|
+
assert_equal(0, Resque.size(:delayed))
|
323
323
|
assert(args[:delay_until] > Time.new)
|
324
324
|
assert(foo =~ /^delayed job executing/)
|
325
325
|
Resque.bypass_queues = false
|
@@ -338,4 +338,14 @@ context "Resque" do
|
|
338
338
|
Resque.enqueue(MistargetedDelayedJob, dargs)
|
339
339
|
end
|
340
340
|
end
|
341
|
+
|
342
|
+
test "hydra works" do
|
343
|
+
20.times do
|
344
|
+
Resque.enqueue(HydraJob, { :one => 'one'})
|
345
|
+
end
|
346
|
+
assert_equal(0, Resque.size(:hydra))
|
347
|
+
assert_equal(20, Resque.size(:hydra1)+Resque.size(:hydra0))
|
348
|
+
assert(0 != Resque.size(:hydra1))
|
349
|
+
assert(0 != Resque.size(:hydra0))
|
350
|
+
end
|
341
351
|
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-igo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 5
|
10
|
+
version: 1.1.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Nathan D Acuff
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-12-01 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|