job_boss 0.7.20 → 0.7.21

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/job.rb +4 -2
  3. metadata +3 -3
@@ -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.20'
7
+ s.version = '0.7.21'
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Brian Underwood"]
10
10
  s.email = ["ml+job_boss@semi-sentient.com"]
@@ -177,7 +177,7 @@ module JobBoss
177
177
  # sleep_interval specifies polling period
178
178
  def wait_for_jobs(jobs = nil, sleep_interval = 0.5)
179
179
  at_exit do
180
- Job.not_completed.where('id in (?)', jobs).cancel
180
+ Job.not_completed.find(jobs).each(&:cancel)
181
181
  end
182
182
 
183
183
  jobs = get_jobs(jobs)
@@ -213,7 +213,9 @@ module JobBoss
213
213
  end
214
214
 
215
215
  def cancelled?
216
- self.where('cancelled_at IS NOT NULL').count == 0
216
+ count = self.where('cancelled_at IS NULL').count
217
+
218
+ !(count > 0)
217
219
  end
218
220
 
219
221
  def cancel(jobs = nil)
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: 43
4
+ hash: 41
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 20
10
- version: 0.7.20
9
+ - 21
10
+ version: 0.7.21
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brian Underwood