quebert 1.0.7 → 1.0.8
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.
- data/lib/quebert/controller/beanstalk.rb +15 -9
- data/lib/quebert/version.rb +1 -1
- metadata +3 -3
@@ -77,16 +77,22 @@ module Quebert
|
|
77
77
|
|
78
78
|
protected
|
79
79
|
def retry_with_delay
|
80
|
-
|
80
|
+
begin
|
81
|
+
delay = TIMEOUT_RETRY_DELAY_SEED + TIMEOUT_RETRY_GROWTH_RATE**beanstalk_job.stats["releases"].to_i
|
81
82
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
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
|
|
data/lib/quebert/version.rb
CHANGED
metadata
CHANGED