blaxter-delayed_job 2.0.3 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  *.gem
2
+ blaxter-delayed_job.gemspec
data/README.markdown CHANGED
@@ -185,6 +185,7 @@ You can invoke `rake jobs:clear` to delete all jobs in the queue.
185
185
 
186
186
  Changes
187
187
  -------
188
+ * 2.0.4: Add `Delayed::HIDE_BACKTRACE` for showing only the first line of the errors avoiding long backtraces
188
189
  * 2.0.3: The only_for feature wasn't working at all
189
190
  * 2.0.2: Only update run_at when it's gonna be executed another time for sure (attempts < max_attempts)
190
191
  * 2.0.1: named_scope Delayed::Job.failed/finished/unfinished (jobs that have failed, have finished ok or still haven't been done)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.3
1
+ 2.0.5
data/lib/delayed/job.rb CHANGED
@@ -238,7 +238,11 @@ module Delayed
238
238
  # This is a good hook if you need to report job processing errors in additional or different ways
239
239
  def log_exception(error)
240
240
  Delayed::Worker.logger.error "* [JOB] #{name} failed with #{error.class.name}: #{error.message} - #{attempts} failed attempts"
241
- Delayed::Worker.logger.error(error)
241
+ if Delayed::HIDE_BACKTRACE
242
+ Delayed::Worker.logger.error error.to_s.split("\n").first
243
+ else
244
+ Delayed::Worker.logger.error error
245
+ end
242
246
  end
243
247
 
244
248
  # Moved into its own method so that new_relic can trace it.
@@ -1,4 +1,6 @@
1
1
  module Delayed
2
+ HIDE_BACKTRACE = true
3
+
2
4
  class Worker
3
5
  SLEEP = 5
4
6
  JOBS_EACH = 100 # Jobs executed in each iteration
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 0
8
- - 3
9
- version: 2.0.3
8
+ - 5
9
+ version: 2.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - "Tobias L\xC3\xBCtke"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-03-22 00:00:00 +01:00
18
+ date: 2010-04-22 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21