1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Make arg display a little more paranoid, fixes #2405

This commit is contained in:
Mike Perham 2015-06-26 10:06:23 -07:00
parent dfa2b446e9
commit e41257e995
2 changed files with 18 additions and 2 deletions

View file

@ -1,3 +1,8 @@
HEAD
-----------
- Safer display of job data in Web UI [#2405]
3.4.1
-----------

View file

@ -169,11 +169,22 @@ module Sidekiq
def display_args(args, truncate_after_chars = 2000)
args.map do |arg|
a = arg.inspect
h(truncate(a))
h(truncate(to_display(arg)))
end.join(", ")
end
def to_display(arg)
begin
arg.inspect
rescue
begin
arg.to_s
rescue => ex
"Cannot display argument: [#{ex.class.name}] #{ex.message}"
end
end
end
RETRY_JOB_KEYS = Set.new(%w(
queue class args retry_count retried_at failed_at
jid error_message error_class backtrace