queue_classic 2.0.0rc7 → 2.0.0rc8

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.
Files changed (2) hide show
  1. data/lib/queue_classic/worker.rb +2 -2
  2. metadata +3 -3
@@ -93,13 +93,12 @@ module QC
93
93
 
94
94
  def lock_job
95
95
  log("worker attempting a lock")
96
- attempts = 1
96
+ attempts = 0
97
97
  job = nil
98
98
  until job
99
99
  job = @queue.lock(@top_bound)
100
100
  if job.nil?
101
101
  log("worker missed lock attempt=#{attempts}")
102
- attempts += 1
103
102
  if attempts < @max_attempts
104
103
  seconds = 2**attempts
105
104
  wait(seconds)
@@ -109,6 +108,7 @@ module QC
109
108
  log("worker reached max attempts. max=#{@max_attempts}")
110
109
  break
111
110
  end
111
+ attempts += 1
112
112
  else
113
113
  log("worker successfully locked job")
114
114
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: queue_classic
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0rc7
4
+ version: 2.0.0rc8
5
5
  prerelease: 5
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-29 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pg
16
- requirement: &15731540 !ruby/object:Gem::Requirement
16
+ requirement: &14406640 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 0.13.2
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *15731540
24
+ version_requirements: *14406640
25
25
  description: queue_classic is a queueing library for Ruby apps. (Rails, Sinatra, Etc...)
26
26
  queue_classic features asynchronous job polling, database maintained locks and no
27
27
  ridiculous dependencies. As a matter of fact, queue_classic only requires pg.