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:
parent
dfa2b446e9
commit
e41257e995
2 changed files with 18 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
HEAD
|
||||||
|
-----------
|
||||||
|
|
||||||
|
- Safer display of job data in Web UI [#2405]
|
||||||
|
|
||||||
3.4.1
|
3.4.1
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
|
|
@ -169,11 +169,22 @@ module Sidekiq
|
||||||
|
|
||||||
def display_args(args, truncate_after_chars = 2000)
|
def display_args(args, truncate_after_chars = 2000)
|
||||||
args.map do |arg|
|
args.map do |arg|
|
||||||
a = arg.inspect
|
h(truncate(to_display(arg)))
|
||||||
h(truncate(a))
|
|
||||||
end.join(", ")
|
end.join(", ")
|
||||||
end
|
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(
|
RETRY_JOB_KEYS = Set.new(%w(
|
||||||
queue class args retry_count retried_at failed_at
|
queue class args retry_count retried_at failed_at
|
||||||
jid error_message error_class backtrace
|
jid error_message error_class backtrace
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue