Skip to content

Commit

Permalink
Shorten the backtrace logged by Resque::Failure::Redis to only includ…
Browse files Browse the repository at this point in the history
…e the job by removing Resque and its callers (like Rake) from the backtrace.
  • Loading branch information
zr40 authored and defunkt committed Jun 25, 2011
1 parent 0a39370 commit d1cfe4d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/resque/failure/redis.rb
Expand Up @@ -9,7 +9,7 @@ def save
:payload => payload,
:exception => exception.class.to_s,
:error => exception.to_s,
:backtrace => Array(exception.backtrace),
:backtrace => filter_backtrace(Array(exception.backtrace)),
:worker => worker.to_s,
:queue => queue
}
Expand Down Expand Up @@ -41,6 +41,10 @@ def self.remove(index)
Resque.redis.lset(:failed, index, id)
Resque.redis.lrem(:failed, 1, id)
end

def filter_backtrace(backtrace)
backtrace.first(backtrace.index {|item| item.include?('/lib/resque/job.rb')})
end
end
end
end

0 comments on commit d1cfe4d

Please sign in to comment.