dalliance 0.2.0 → 0.2.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/lib/dalliance/version.rb
CHANGED
data/lib/dalliance.rb
CHANGED
@@ -151,7 +151,7 @@ module Dalliance
|
|
151
151
|
error_dalliance!
|
152
152
|
|
153
153
|
#Don't raise the error if we're backgound_processing...
|
154
|
-
raise e unless backgound_processing
|
154
|
+
raise e unless backgound_processing && self.class.dalliance_options[:worker_class].rescue_error?
|
155
155
|
ensure
|
156
156
|
if self.class.dalliance_options[:dalliance_progress_meter] && dalliance_progress_meter
|
157
157
|
#Works with optimistic locking...
|
@@ -40,12 +40,18 @@ describe DallianceModel do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
it "should call the dalliance_method w/ a Delayed::Worker" do
|
43
|
+
Resque::Stat.clear(:processed)
|
44
|
+
Resque::Stat.clear(:failed)
|
45
|
+
|
43
46
|
subject.dalliance_background_process
|
44
47
|
Resque::Worker.new(:dalliance).process
|
45
48
|
subject.reload
|
46
49
|
|
47
50
|
subject.should be_successful
|
48
51
|
Resque.size(:dalliance).should == 0
|
52
|
+
|
53
|
+
Resque::Stat[:processed].should == 1
|
54
|
+
Resque::Stat[:failed].should == 0
|
49
55
|
end
|
50
56
|
|
51
57
|
it "should set the dalliance_status to completed" do
|
@@ -113,11 +119,17 @@ describe DallianceModel do
|
|
113
119
|
end
|
114
120
|
|
115
121
|
it "should NOT raise an error" do
|
122
|
+
Resque::Stat.clear(:processed)
|
123
|
+
Resque::Stat.clear(:failed)
|
124
|
+
|
116
125
|
subject.dalliance_background_process
|
117
126
|
|
118
127
|
Resque::Worker.new(:dalliance).process
|
119
128
|
|
120
129
|
Resque.size(:dalliance).should == 0
|
130
|
+
|
131
|
+
Resque::Stat[:processed].should == 1
|
132
|
+
Resque::Stat[:failed].should == 1
|
121
133
|
end
|
122
134
|
|
123
135
|
it "should store the error" do
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dalliance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.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:
|
12
|
+
date: 2013-01-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|