Skip to content

Commit

Permalink
fix code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mperham committed Apr 8, 2022
1 parent 653c398 commit 152c3d8
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions lib/sidekiq/api.rb
Expand Up @@ -354,31 +354,31 @@ def display_class
def display_args
# Unwrap known wrappers so they show up in a human-friendly manner in the Web UI
@display_args ||= case klass
when /\ASidekiq::Extensions::Delayed/
safe_load(args[0], args) do |_, _, arg, kwarg|
if !kwarg || kwarg.empty?
arg
else
[arg, kwarg]
end
end
when "ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper"
job_args = self["wrapped"] ? args[0]["arguments"] : []
if (self["wrapped"] || args[0]) == "ActionMailer::DeliveryJob"
# remove MailerClass, mailer_method and 'deliver_now'
job_args.drop(3)
elsif (self["wrapped"] || args[0]) == "ActionMailer::MailDeliveryJob"
# remove MailerClass, mailer_method and 'deliver_now'
job_args.drop(3).first["args"]
else
job_args
end
else
if self["encrypt"]
# no point in showing 150+ bytes of random garbage
args[-1] = "[encrypted data]"
end
args
when /\ASidekiq::Extensions::Delayed/
safe_load(args[0], args) do |_, _, arg, kwarg|
if !kwarg || kwarg.empty?
arg
else
[arg, kwarg]
end
end
when "ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper"
job_args = self["wrapped"] ? args[0]["arguments"] : []
if (self["wrapped"] || args[0]) == "ActionMailer::DeliveryJob"
# remove MailerClass, mailer_method and 'deliver_now'
job_args.drop(3)
elsif (self["wrapped"] || args[0]) == "ActionMailer::MailDeliveryJob"
# remove MailerClass, mailer_method and 'deliver_now'
job_args.drop(3).first["args"]
else
job_args
end
else
if self["encrypt"]
# no point in showing 150+ bytes of random garbage
args[-1] = "[encrypted data]"
end
args
end
end

Expand Down

0 comments on commit 152c3d8

Please sign in to comment.