boss_queue 0.3.0 → 0.3.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.
- data/VERSION +1 -1
- data/boss_queue.gemspec +2 -2
- data/lib/boss_queue/job.rb +9 -3
- data/spec/job_spec.rb +9 -0
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
data/boss_queue.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "boss_queue"
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Daniel Nelson"]
|
12
|
-
s.date = "2013-10-
|
12
|
+
s.date = "2013-10-07"
|
13
13
|
s.description = "A fault tolerant job queue built around Amazon SQS & DynamoDB"
|
14
14
|
s.email = "daniel@populr.me"
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/boss_queue/job.rb
CHANGED
@@ -78,9 +78,15 @@ class BossQueue
|
|
78
78
|
self.save!
|
79
79
|
|
80
80
|
elsif failure_action == 'callback' &&
|
81
|
-
failure_callback
|
82
|
-
|
83
|
-
|
81
|
+
failure_callback
|
82
|
+
|
83
|
+
callback_called = target.send(failure_callback, *arguments) rescue nil
|
84
|
+
if callback_called
|
85
|
+
destroy
|
86
|
+
else
|
87
|
+
self.failed = true
|
88
|
+
self.save!
|
89
|
+
end
|
84
90
|
|
85
91
|
else
|
86
92
|
self.failed = true
|
data/spec/job_spec.rb
CHANGED
@@ -355,6 +355,15 @@ describe "BossQueue::Job" do
|
|
355
355
|
@job.failed.should be_true
|
356
356
|
end
|
357
357
|
end
|
358
|
+
|
359
|
+
context "when finding the target to call back raises an exception" do
|
360
|
+
it "should not raise an exception" do
|
361
|
+
@job.stub(:target).and_raise('object not found')
|
362
|
+
lambda {
|
363
|
+
@job.fail(@err)
|
364
|
+
}.should_not raise_error
|
365
|
+
end
|
366
|
+
end
|
358
367
|
end
|
359
368
|
|
360
369
|
context "when failure_action is 'retry'" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boss_queue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-10-
|
12
|
+
date: 2013-10-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aws-sdk
|
@@ -160,7 +160,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
160
160
|
version: '0'
|
161
161
|
segments:
|
162
162
|
- 0
|
163
|
-
hash:
|
163
|
+
hash: -2145018656605300488
|
164
164
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
165
|
none: false
|
166
166
|
requirements:
|