job_boss 0.7.9 → 0.7.10

Sign up to get free protection for your applications and to get access to all the features.
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
- puts "Test puts"
36
- boss.logger.info "Before boss.stop"
37
- boss.stop
38
- boss.logger.info "After boss.stop"
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
@@ -4,7 +4,7 @@ $:.unshift lib unless $:.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "job_boss"
7
- s.version = '0.7.9'
7
+ s.version = '0.7.10'
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Brian Underwood"]
10
10
  s.email = ["ml+job_boss@semi-sentient.com"]
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, :completed_at => Time.now, :status => 'cancelled')
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: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 9
10
- version: 0.7.9
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-24 00:00:00 -04:00
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