resque-multi-step 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt ADDED
@@ -0,0 +1,9 @@
1
+ Version 1.1.2
2
+ =====
3
+
4
+ Fixed race condition around task finalization which caused some jobs to fail FinalizationAlreadyBegun errors. This did not negatively impact task completion but it did clutter the failed job queue.
5
+
6
+ Version 1.0.0
7
+ =======
8
+
9
+ Initial port of internal code to support multi step tasks.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.1
1
+ 1.1.2
@@ -17,6 +17,11 @@ module Resque
17
17
  class NoSuchMultiStepTask < StandardError; end
18
18
  class NotReadyForFinalization < StandardError; end
19
19
  class FinalizationAlreadyBegun < StandardError; end
20
+ class StdOutLogger
21
+ def warn(*args); puts args; end
22
+ def info(*args); puts args; end
23
+ def debug(*args); puts args; end
24
+ end
20
25
 
21
26
  class << self
22
27
  include Constantization
@@ -285,6 +290,10 @@ module Resque
285
290
  def maybe_finalize
286
291
  return unless ready_for_finalization? && !incomplete_because_of_errors?
287
292
  finalize!
293
+ rescue FinalizationAlreadyBegun
294
+ # Just eat it the exception. Sometimes multiple normal jobs
295
+ # will try to finalize a task simultaneously. This is
296
+ # expected behavior because normal jobs run in parallel.
288
297
  end
289
298
 
290
299
  # Is this task at the point where finalization can occur.
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{resque-multi-step}
8
- s.version = "1.1.1"
8
+ s.version = "1.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Peter Williams", "Morgan Whitney"]
12
- s.date = %q{2011-02-28}
12
+ s.date = %q{2011-03-14}
13
13
  s.description = %q{Provides multi-step tasks with finalization and progress tracking}
14
14
  s.email = %q{pezra@barelyenough.org}
15
15
  s.extra_rdoc_files = [
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
+ "History.txt",
21
22
  "LICENSE",
22
23
  "README.md",
23
24
  "Rakefile",
@@ -124,7 +124,7 @@ module Resque::Plugins
124
124
  task.add_job(TestJob, "my", "args") rescue nil
125
125
  task.finalizable!
126
126
 
127
- task.should be_incomplete_because_of_error
127
+ task.should be_incomplete_because_of_errors
128
128
  end
129
129
 
130
130
  it "knows it has failed if a finalized job raises an exception" do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 1
8
- - 1
9
- version: 1.1.1
8
+ - 2
9
+ version: 1.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Peter Williams
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-28 00:00:00 -07:00
18
+ date: 2011-03-14 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -107,6 +107,7 @@ extra_rdoc_files:
107
107
  - README.md
108
108
  files:
109
109
  - .document
110
+ - History.txt
110
111
  - LICENSE
111
112
  - README.md
112
113
  - Rakefile