quebert 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/quebert/controller/beanstalk.rb +13 -6
- data/lib/quebert/job.rb +1 -2
- data/lib/quebert/version.rb +1 -1
- metadata +3 -3
@@ -47,15 +47,19 @@ module Quebert
|
|
47
47
|
log "Completed in #{(time*1000*1000).to_i/1000.to_f} ms\n"
|
48
48
|
result
|
49
49
|
rescue Job::Delete
|
50
|
+
log "Deleting job", :error
|
50
51
|
beanstalk_job.delete
|
51
|
-
log "
|
52
|
+
log "Job deleted", :error
|
52
53
|
rescue Job::Release
|
54
|
+
log "Releasing with priority: #{@job.priority} and delay: #{@job.delay}", :error
|
53
55
|
beanstalk_job.release @job.priority, @job.delay
|
54
|
-
log "
|
56
|
+
log "Job released", :error
|
55
57
|
rescue Job::Bury
|
58
|
+
log "Burrying job", :error
|
56
59
|
beanstalk_job.bury
|
57
|
-
log "
|
60
|
+
log "Job burried", :error
|
58
61
|
rescue Job::Timeout => e
|
62
|
+
log "Job timed out!", :error
|
59
63
|
retry_with_delay
|
60
64
|
raise e
|
61
65
|
rescue Job::Retry => e
|
@@ -64,8 +68,9 @@ module Quebert
|
|
64
68
|
log "Manually retrying with delay"
|
65
69
|
retry_with_delay
|
66
70
|
rescue Exception => e
|
71
|
+
log "Exception caught on perform. Burrying job. #{e.inspect}", :error
|
67
72
|
beanstalk_job.bury
|
68
|
-
log "
|
73
|
+
log "Job buried", :error
|
69
74
|
raise e
|
70
75
|
end
|
71
76
|
end
|
@@ -75,11 +80,13 @@ module Quebert
|
|
75
80
|
delay = TIMEOUT_RETRY_DELAY_SEED + TIMEOUT_RETRY_GROWTH_RATE**beanstalk_job.stats["releases"].to_i
|
76
81
|
|
77
82
|
if delay > MAX_TIMEOUT_RETRY_DELAY
|
83
|
+
log "Max retry delay exceeded. Burrying job"
|
78
84
|
beanstalk_job.bury
|
79
|
-
log "
|
85
|
+
log "Job burried"
|
80
86
|
else
|
81
|
-
beanstalk_job.release @job.priority, delay
|
82
87
|
log "TTR exceeded. Releasing with priority: #{@job.priority} and delay: #{delay}"
|
88
|
+
beanstalk_job.release @job.priority, delay
|
89
|
+
log "Job released"
|
83
90
|
end
|
84
91
|
end
|
85
92
|
|
data/lib/quebert/job.rb
CHANGED
data/lib/quebert/version.rb
CHANGED
metadata
CHANGED