mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 06:52:46 +08:00
FIX: Don't raise an error cleaning up uploads if a path is nil
This commit is contained in:
parent
602e4d0da4
commit
d92c938491
|
@ -16,9 +16,13 @@ module Jobs
|
|||
SiteSetting.favicon_url,
|
||||
SiteSetting.apple_touch_icon_url,
|
||||
].map do |url|
|
||||
url = url.dup
|
||||
url.gsub!(s3_cdn_hostname, s3_hostname) if s3_cdn_hostname.present?
|
||||
url[base_url] && url[url.index(base_url)..-1]
|
||||
if url.present?
|
||||
url = url.dup
|
||||
url.gsub!(s3_cdn_hostname, s3_hostname) if s3_cdn_hostname.present?
|
||||
url[base_url] && url[url.index(base_url)..-1]
|
||||
else
|
||||
nil
|
||||
end
|
||||
end.compact.uniq
|
||||
|
||||
grace_period = [SiteSetting.clean_orphan_uploads_grace_period_hours, 1].max
|
||||
|
|
Loading…
Reference in New Issue
Block a user