job_boss 0.7.12 → 0.7.13
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/job_boss.gemspec +1 -1
- data/lib/job_boss/boss.rb +4 -0
- data/lib/job_boss/job.rb +3 -1
- metadata +4 -4
data/job_boss.gemspec
CHANGED
data/lib/job_boss/boss.rb
CHANGED
data/lib/job_boss/job.rb
CHANGED
@@ -10,6 +10,7 @@ module JobBoss
|
|
10
10
|
scope :pending, where('started_at IS NULL AND cancelled_at IS NULL')
|
11
11
|
scope :running, where('started_at IS NOT NULL AND completed_at IS NULL')
|
12
12
|
scope :completed, where('completed_at IS NOT NULL')
|
13
|
+
scope :not_completed, where('completed_at IS NOT NULL')
|
13
14
|
scope :mia, where("completed_at IS NOT NULL AND status = 'mia'")
|
14
15
|
|
15
16
|
def prototype
|
@@ -74,6 +75,7 @@ module JobBoss
|
|
74
75
|
self.started_at = nil
|
75
76
|
self.result = nil
|
76
77
|
self.completed_at = nil
|
78
|
+
self.cancelled_at = nil
|
77
79
|
self.status = nil
|
78
80
|
self.error_class = nil
|
79
81
|
self.error_message = nil
|
@@ -174,7 +176,7 @@ module JobBoss
|
|
174
176
|
# sleep_interval specifies polling period
|
175
177
|
def wait_for_jobs(jobs = nil, sleep_interval = 0.5)
|
176
178
|
at_exit do
|
177
|
-
jobs.each(&:cancel)
|
179
|
+
Job.not_completed.find(jobs).each(&:cancel)
|
178
180
|
end
|
179
181
|
|
180
182
|
jobs = get_jobs(jobs)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: job_boss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 13
|
10
|
+
version: 0.7.13
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Brian Underwood
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-04-01 00:00:00 -04:00
|
19
19
|
default_executable: job_boss
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|