resque-multi-step 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -31,7 +31,7 @@ RSpec::Core::RakeTask.new(:spec)
31
31
 
32
32
  task :default => :spec
33
33
 
34
- require 'rake/rdoctask'
34
+ require 'rdoc/task'
35
35
  Rake::RDocTask.new do |rdoc|
36
36
  version = File.exist?('VERSION') ? File.read('VERSION') : ""
37
37
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.1
1
+ 2.0.2
@@ -6,6 +6,7 @@ module Resque
6
6
  class_eval <<-INCR
7
7
  def increment_#{name}
8
8
  redis.incrby('#{name}', 1)
9
+ logger.info("[Resque Multi-Step-Task] Incremented #{name}")
9
10
  end
10
11
  INCR
11
12
 
@@ -17,10 +17,11 @@ module Resque
17
17
  klass.singleton_class.class_eval "def multi_step_task_id; @@task_id ||= '#{task_id}'; end"
18
18
  klass.perform(*args)
19
19
  rescue Exception
20
+ logger.info("[Resque Multi-Step-Task] Incrementing failed_count: Finalization job #{job_module_name} failed for task id #{task_id} at #{Time.now} (args: #{args})")
20
21
  task.increment_failed_count
21
22
  raise
22
23
  end
23
-
24
+ logger.info("[Resque Multi-Step-Task] Incrementing completed_count: Finalization job #{job_module_name} completed for task id #{task_id} at #{Time.now} (args: #{args})")
24
25
  task.increment_completed_count
25
26
 
26
27
  if fin_job_info = task.redis.lpop('finalize_jobs')
@@ -33,6 +34,10 @@ module Resque
33
34
  end
34
35
 
35
36
  end
37
+
38
+ def self.logger
39
+ Resque::Plugins::MultiStepTask.logger
40
+ end
36
41
  end
37
42
  end
38
43
  end
@@ -115,9 +115,11 @@ module Resque
115
115
  logger.debug("[Resque Multi-Step-Task] Finished executing #{job_module_name} job for #{task_id} at #{Time.now}, taking #{(Time.now - start_time)} seconds.")
116
116
  rescue Exception => e
117
117
  logger.error("[Resque Multi-Step-Task] #{job_module_name} job failed for #{task_id} at #{Time.now} (args: #{args})")
118
+ logger.info("[Resque Multi-Step-Task] Incrementing failed_count: #{job_module_name} job failed for task id #{task_id} at #{Time.now} (args: #{args})")
118
119
  task.increment_failed_count
119
120
  raise
120
121
  end
122
+ logger.info("[Resque Multi-Step-Task] Incrementing completed_count: #{job_module_name} job completed for task id #{task_id} at #{Time.now} (args: #{args})")
121
123
  task.increment_completed_count
122
124
  task
123
125
  end
@@ -149,6 +151,7 @@ module Resque
149
151
  @@synchronous
150
152
  end
151
153
  @@synchronous = false
154
+
152
155
  end
153
156
 
154
157
  def synchronous?
@@ -210,6 +213,8 @@ module Resque
210
213
  #
211
214
  # @param [Class,Module] job_type The type of the job to be performed.
212
215
  def add_job(job_type, *args)
216
+ logger.info("[Resque Multi-Step-Task] Incrementing normal_job_count: #{job_type} job added to task id #{task_id} at #{Time.now} (args: #{args})")
217
+
213
218
  increment_normal_job_count
214
219
  logger.debug("[Resque Multi-Step-Task] Adding #{job_type} job for #{task_id} (args: #{args})")
215
220
 
@@ -226,6 +231,7 @@ module Resque
226
231
  #
227
232
  # @param [Class,Module] job_type The type of job to be performed.
228
233
  def add_finalization_job(job_type, *args)
234
+ logger.info("[Resque Multi-Step-Task] Incrementing finalize_job_count: Finalization job #{job_type} for task id #{task_id} at #{Time.now} (args: #{args})")
229
235
  increment_finalize_job_count
230
236
  logger.debug("[Resque Multi-Step-Task] Adding #{job_type} finalization job for #{task_id} (args: #{args})")
231
237
 
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "resque-multi-step"
8
- s.version = "2.0.1"
8
+ s.version = "2.0.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 = "2012-09-13"
12
+ s.date = "2013-04-03"
13
13
  s.description = "Provides multi-step tasks with finalization and progress tracking"
14
14
  s.email = "pezra@barelyenough.org"
15
15
  s.extra_rdoc_files = [
@@ -42,19 +42,21 @@ Gem::Specification.new do |s|
42
42
  ]
43
43
  s.homepage = "http://github.com/pezra/resque-multi-step"
44
44
  s.require_paths = ["lib"]
45
- s.rubygems_version = "1.8.16"
45
+ s.rubygems_version = "1.8.24"
46
46
  s.summary = "Provides multi-step tasks with finalization and progress tracking"
47
47
 
48
48
  if s.respond_to? :specification_version then
49
49
  s.specification_version = 3
50
50
 
51
51
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
52
+ s.add_runtime_dependency(%q<resque-multi-step>, [">= 0"])
52
53
  s.add_development_dependency(%q<rspec>, [">= 0"])
53
54
  s.add_runtime_dependency(%q<redis-namespace>, [">= 0"])
54
55
  s.add_runtime_dependency(%q<yajl-ruby>, [">= 0"])
55
56
  s.add_runtime_dependency(%q<resque>, [">= 0"])
56
57
  s.add_runtime_dependency(%q<resque-fairly>, [">= 0"])
57
58
  else
59
+ s.add_dependency(%q<resque-multi-step>, [">= 0"])
58
60
  s.add_dependency(%q<rspec>, [">= 0"])
59
61
  s.add_dependency(%q<redis-namespace>, [">= 0"])
60
62
  s.add_dependency(%q<yajl-ruby>, [">= 0"])
@@ -62,6 +64,7 @@ Gem::Specification.new do |s|
62
64
  s.add_dependency(%q<resque-fairly>, [">= 0"])
63
65
  end
64
66
  else
67
+ s.add_dependency(%q<resque-multi-step>, [">= 0"])
65
68
  s.add_dependency(%q<rspec>, [">= 0"])
66
69
  s.add_dependency(%q<redis-namespace>, [">= 0"])
67
70
  s.add_dependency(%q<yajl-ruby>, [">= 0"])
@@ -143,6 +143,7 @@ describe "Acceptance: Task needing to reference the original Multi-Step-Task" do
143
143
  end
144
144
 
145
145
  it "completes successfully and removes the queue" do
146
+ 5.times {sleep 1 if Resque::Failure.count < 1}
146
147
  Resque.queues.should_not include(task.queue_name)
147
148
  end
148
149
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-multi-step
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,27 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-09-13 00:00:00.000000000Z
13
+ date: 2013-04-03 00:00:00.000000000 Z
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: resque-multi-step
17
+ requirement: !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ! '>='
29
+ - !ruby/object:Gem::Version
30
+ version: '0'
15
31
  - !ruby/object:Gem::Dependency
16
32
  name: rspec
17
- requirement: &2151907460 !ruby/object:Gem::Requirement
33
+ requirement: !ruby/object:Gem::Requirement
18
34
  none: false
19
35
  requirements:
20
36
  - - ! '>='
@@ -22,10 +38,15 @@ dependencies:
22
38
  version: '0'
23
39
  type: :development
24
40
  prerelease: false
25
- version_requirements: *2151907460
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
26
47
  - !ruby/object:Gem::Dependency
27
48
  name: redis-namespace
28
- requirement: &2151904820 !ruby/object:Gem::Requirement
49
+ requirement: !ruby/object:Gem::Requirement
29
50
  none: false
30
51
  requirements:
31
52
  - - ! '>='
@@ -33,10 +54,15 @@ dependencies:
33
54
  version: '0'
34
55
  type: :runtime
35
56
  prerelease: false
36
- version_requirements: *2151904820
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
37
63
  - !ruby/object:Gem::Dependency
38
64
  name: yajl-ruby
39
- requirement: &2151902620 !ruby/object:Gem::Requirement
65
+ requirement: !ruby/object:Gem::Requirement
40
66
  none: false
41
67
  requirements:
42
68
  - - ! '>='
@@ -44,10 +70,15 @@ dependencies:
44
70
  version: '0'
45
71
  type: :runtime
46
72
  prerelease: false
47
- version_requirements: *2151902620
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
48
79
  - !ruby/object:Gem::Dependency
49
80
  name: resque
50
- requirement: &2151899640 !ruby/object:Gem::Requirement
81
+ requirement: !ruby/object:Gem::Requirement
51
82
  none: false
52
83
  requirements:
53
84
  - - ! '>='
@@ -55,10 +86,15 @@ dependencies:
55
86
  version: '0'
56
87
  type: :runtime
57
88
  prerelease: false
58
- version_requirements: *2151899640
89
+ version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ! '>='
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
59
95
  - !ruby/object:Gem::Dependency
60
96
  name: resque-fairly
61
- requirement: &2151897360 !ruby/object:Gem::Requirement
97
+ requirement: !ruby/object:Gem::Requirement
62
98
  none: false
63
99
  requirements:
64
100
  - - ! '>='
@@ -66,7 +102,12 @@ dependencies:
66
102
  version: '0'
67
103
  type: :runtime
68
104
  prerelease: false
69
- version_requirements: *2151897360
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
70
111
  description: Provides multi-step tasks with finalization and progress tracking
71
112
  email: pezra@barelyenough.org
72
113
  executables: []
@@ -117,8 +158,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
158
  version: '0'
118
159
  requirements: []
119
160
  rubyforge_project:
120
- rubygems_version: 1.8.16
161
+ rubygems_version: 1.8.23
121
162
  signing_key:
122
163
  specification_version: 3
123
164
  summary: Provides multi-step tasks with finalization and progress tracking
124
165
  test_files: []
166
+ has_rdoc: