quebert 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -77,16 +77,22 @@ module Quebert
77
77
 
78
78
  protected
79
79
  def retry_with_delay
80
- delay = TIMEOUT_RETRY_DELAY_SEED + TIMEOUT_RETRY_GROWTH_RATE**beanstalk_job.stats["releases"].to_i
80
+ begin
81
+ delay = TIMEOUT_RETRY_DELAY_SEED + TIMEOUT_RETRY_GROWTH_RATE**beanstalk_job.stats["releases"].to_i
81
82
 
82
- if delay > MAX_TIMEOUT_RETRY_DELAY
83
- log "Max retry delay exceeded. Burrying job"
84
- beanstalk_job.bury
85
- log "Job burried"
86
- else
87
- log "TTR exceeded. Releasing with priority: #{@job.priority} and delay: #{delay}"
88
- beanstalk_job.release @job.priority, delay
89
- log "Job released"
83
+ if delay > MAX_TIMEOUT_RETRY_DELAY
84
+ log "Max retry delay exceeded. Burrying job"
85
+ beanstalk_job.bury
86
+ log "Job burried"
87
+ else
88
+ log "TTR exceeded. Releasing with priority: #{@job.priority} and delay: #{delay}"
89
+ beanstalk_job.release @job.priority, delay
90
+ log "Job released"
91
+ end
92
+ rescue Beanstalk::NotFoundError => e
93
+ log "Job ran longer than allowed. Beanstalk already deleted it!!!!", :error
94
+ # Sometimes the timer doesn't behave correctly and this job actually runs longer than
95
+ # allowed. At that point the beanstalk job no longer exists anymore. Lets let it go and don't blow up.
90
96
  end
91
97
  end
92
98
 
@@ -1,3 +1,3 @@
1
1
  module Quebert
2
- VERSION = "1.0.7"
2
+ VERSION = "1.0.8"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quebert
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 7
10
- version: 1.0.7
9
+ - 8
10
+ version: 1.0.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brad Gessler