job_boss 0.7.9 → 0.7.10
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/bin/job_boss +4 -6
- data/job_boss.gemspec +1 -1
- data/lib/job_boss/job.rb +3 -2
- metadata +4 -4
data/bin/job_boss
CHANGED
@@ -32,12 +32,10 @@ Daemons.run_proc('job_boss', daemons_options) do
|
|
32
32
|
end
|
33
33
|
|
34
34
|
at_exit do
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
boss = JobBoss::Boss.new
|
40
|
-
boss.logger.info "test log!!!!!!!"
|
35
|
+
if BOSS_PID == Process.pid
|
36
|
+
boss.stop
|
37
|
+
boss = JobBoss::Boss.new
|
38
|
+
end
|
41
39
|
end
|
42
40
|
|
43
41
|
boss.start
|
data/job_boss.gemspec
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_cancelled, where('cancelled_at IS NULL')
|
13
14
|
scope :mia, where("completed_at IS NOT NULL AND status = 'mia'")
|
14
15
|
|
15
16
|
def prototype
|
@@ -182,7 +183,7 @@ module JobBoss
|
|
182
183
|
|
183
184
|
ids = jobs.collect(&:id)
|
184
185
|
Job.uncached do
|
185
|
-
until Job.completed.find_all_by_id(ids).count == jobs.size
|
186
|
+
until Job.completed.not_cancelled.find_all_by_id(ids).count == jobs.size
|
186
187
|
sleep(sleep_interval)
|
187
188
|
|
188
189
|
if block_given?
|
@@ -239,7 +240,7 @@ private
|
|
239
240
|
end
|
240
241
|
|
241
242
|
def mark_as_cancelled
|
242
|
-
update_attributes(:cancelled_at => Time.now
|
243
|
+
update_attributes(:cancelled_at => Time.now)
|
243
244
|
end
|
244
245
|
|
245
246
|
def mark_employee
|
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: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 10
|
10
|
+
version: 0.7.10
|
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-03-
|
18
|
+
date: 2011-03-29 00:00:00 -04:00
|
19
19
|
default_executable: job_boss
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|