job_boss 0.7.5 → 0.7.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/job_boss.gemspec +1 -1
  2. data/lib/job_boss/boss.rb +8 -3
  3. metadata +9 -3
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.5'
7
+ s.version = '0.7.6'
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/boss.rb CHANGED
@@ -90,7 +90,10 @@ module JobBoss
90
90
  while true
91
91
  available_employee_count = wait_for_available_employees
92
92
 
93
- jobs = dequeue_jobs if jobs.empty?
93
+ if jobs.empty?
94
+ jobs = dequeue_jobs
95
+ jobs.each {|job| job.update_attributes(:started_at => Time.now) }
96
+ end
94
97
 
95
98
  [available_employee_count, jobs.size].min.times do
96
99
  job = jobs.shift
@@ -179,8 +182,10 @@ private
179
182
 
180
183
  require 'job_boss/job'
181
184
  unless Job.table_exists?
182
- require 'migrate'
183
- CreateJobs.up
185
+ Job.transaction do
186
+ require 'migrate'
187
+ CreateJobs.up
188
+ end
184
189
  end
185
190
  end
186
191
 
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: job_boss
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 15
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 7
8
- - 5
9
- version: 0.7.5
9
+ - 6
10
+ version: 0.7.6
10
11
  platform: ruby
11
12
  authors:
12
13
  - Brian Underwood
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2011-02-27 00:00:00 -05:00
18
+ date: 2011-03-07 00:00:00 -05:00
18
19
  default_executable: job_boss
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
@@ -25,6 +26,7 @@ dependencies:
25
26
  requirements:
26
27
  - - ">="
27
28
  - !ruby/object:Gem::Version
29
+ hash: 3
28
30
  segments:
29
31
  - 0
30
32
  version: "0"
@@ -38,6 +40,7 @@ dependencies:
38
40
  requirements:
39
41
  - - ">="
40
42
  - !ruby/object:Gem::Version
43
+ hash: 3
41
44
  segments:
42
45
  - 0
43
46
  version: "0"
@@ -51,6 +54,7 @@ dependencies:
51
54
  requirements:
52
55
  - - ">="
53
56
  - !ruby/object:Gem::Version
57
+ hash: 3
54
58
  segments:
55
59
  - 0
56
60
  version: "0"
@@ -168,6 +172,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
168
172
  requirements:
169
173
  - - ">="
170
174
  - !ruby/object:Gem::Version
175
+ hash: 3
171
176
  segments:
172
177
  - 0
173
178
  version: "0"
@@ -176,6 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
181
  requirements:
177
182
  - - ">="
178
183
  - !ruby/object:Gem::Version
184
+ hash: 23
179
185
  segments:
180
186
  - 1
181
187
  - 3