quebert 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 "Deleted", :error
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 "Released with priority: #{@job.priority} and delay: #{@job.delay}", :error
56
+ log "Job released", :error
55
57
  rescue Job::Bury
58
+ log "Burrying job", :error
56
59
  beanstalk_job.bury
57
- log "Burried", :error
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 "Exception caught on perform. Job buried. #{e.inspect}", :error
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 "Max retry delay exceeded. Burrying job."
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
@@ -59,8 +59,7 @@ module Quebert
59
59
  begin
60
60
  Quebert::Timeout.timeout(@ttr){ perform(*args) }
61
61
  rescue ::Timeout::Error => e
62
- log e.backtrace.join('\n'), :error
63
- raise Job::Timeout, e.message, caller
62
+ raise Job::Timeout, e.backtrace.join('\n'), caller
64
63
  end
65
64
  end
66
65
 
@@ -1,3 +1,3 @@
1
1
  module Quebert
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.6"
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: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 5
10
- version: 1.0.5
9
+ - 6
10
+ version: 1.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brad Gessler