mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 15:25:35 +08:00
FIX: make uploads recovery compatible with multisite.
This commit is contained in:
parent
50db6a1d62
commit
a1fc35fdf7
|
@ -135,10 +135,17 @@ class UploadRecovery
|
|||
@object_keys ||= begin
|
||||
s3_helper = Discourse.store.s3_helper
|
||||
|
||||
if Rails.configuration.multisite
|
||||
current_db = RailsMultisite::ConnectionManagement.current_db
|
||||
s3_helper.list("uploads/#{current_db}/original").map(&:key).concat(
|
||||
s3_helper.list("uploads/#{FileStore::S3Store::TOMBSTONE_PREFIX}#{current_db}/original").map(&:key)
|
||||
)
|
||||
else
|
||||
s3_helper.list("original").map(&:key).concat(
|
||||
s3_helper.list("#{FileStore::S3Store::TOMBSTONE_PREFIX}original").map(&:key)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
@object_keys.each do |key|
|
||||
if key =~ /#{sha1}/
|
||||
|
|
Loading…
Reference in New Issue
Block a user