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

Fix Uncaught exception: can't dump IO (#5022)

This commit is contained in:
Ivy Evans 2021-10-12 17:14:55 -07:00 committed by GitHub
parent 06d43cb49f
commit 1f05bd6010
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -94,12 +94,10 @@ module Sidekiq
def log_info(options)
redacted = "REDACTED"
# deep clone so we can muck with these options all we want
#
# exclude SSL params from dump-and-load because some information isn't
# safely dumpable in current Rubies
keys = options.keys
keys.delete(:ssl_params)
# Deep clone so we can muck with these options all we want and exclude
# params from dump-and-load that may contain objects that Marshal is
# unable to safely dump.
keys = options.keys - [:logger, :ssl_params]
scrubbed_options = Marshal.load(Marshal.dump(options.slice(*keys)))
if scrubbed_options[:url] && (uri = URI.parse(scrubbed_options[:url])) && uri.password
uri.password = redacted