mobilize-base 1.0.52 → 1.0.53
Sign up to get free protection for your applications and to get access to all the features.
@@ -17,7 +17,6 @@ module Mobilize
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def Resque.workers(state="all")
|
20
|
-
raise "invalid state #{state}" unless ['all','idle','working','timeout'].include?(state)
|
21
20
|
workers = ::Resque.workers.select{|w| w.queues.first == Resque.queue_name}
|
22
21
|
return workers if state == 'all'
|
23
22
|
working_workers = workers.select{|w| w.job['queue']== Resque.queue_name}
|
@@ -28,6 +27,7 @@ module Mobilize
|
|
28
27
|
return stale_workers if state == 'stale'
|
29
28
|
timeout_workers = workers.select{|w| w.job['payload'] and w.job['payload']['class']!='Jobtracker' and w.job['runat'] < (Time.now.utc - Jobtracker.max_run_time)}
|
30
29
|
return timeout_workers if state == 'timeout'
|
30
|
+
raise "invalid state #{state}"
|
31
31
|
end
|
32
32
|
|
33
33
|
def Resque.failures
|
@@ -36,7 +36,6 @@ module Mobilize
|
|
36
36
|
|
37
37
|
#active state refers to jobs that are either queued or working
|
38
38
|
def Resque.jobs(state="active")
|
39
|
-
raise "invalid state #{state}" unless ['all','queued','working','active','timeout','failed'].include?(state)
|
40
39
|
working_jobs = Resque.workers('working').map{|w| w.job['payload']}
|
41
40
|
return working_jobs if state == 'working'
|
42
41
|
queued_jobs = ::Resque.peek(Resque.queue_name,0,0).to_a
|
@@ -47,6 +46,7 @@ module Mobilize
|
|
47
46
|
timeout_jobs = Resque.workers("timeout").map{|w| w.job['payload']}
|
48
47
|
return timeout_jobs if state == 'timeout'
|
49
48
|
return working_jobs + queued_jobs + failed_jobs if state == 'all'
|
49
|
+
raise "invalid state #{state}"
|
50
50
|
end
|
51
51
|
|
52
52
|
def Resque.active_paths
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mobilize-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.53
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -255,7 +255,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
255
255
|
version: '0'
|
256
256
|
segments:
|
257
257
|
- 0
|
258
|
-
hash:
|
258
|
+
hash: 3136122815792063688
|
259
259
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
260
260
|
none: false
|
261
261
|
requirements:
|
@@ -264,7 +264,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
264
264
|
version: '0'
|
265
265
|
segments:
|
266
266
|
- 0
|
267
|
-
hash:
|
267
|
+
hash: 3136122815792063688
|
268
268
|
requirements: []
|
269
269
|
rubyforge_project: mobilize-base
|
270
270
|
rubygems_version: 1.8.24
|