mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
FIX: error setting tombstone bucket when set to old version
This commit is contained in:
@ -100,12 +100,24 @@ class S3Helper
|
||||
# skip trying to merge
|
||||
end
|
||||
|
||||
# in the past we has a rule that was called purge-tombstone vs purge_tombstone
|
||||
# just go ahead and normalize for our bucket
|
||||
rules.delete_if do |r|
|
||||
r.id == id
|
||||
r.id.gsub('_', '-') == id.gsub('_', '-')
|
||||
end
|
||||
|
||||
rules << rule
|
||||
|
||||
# normalize filter in rules, due to AWS library bug
|
||||
rules = rules.map do |r|
|
||||
r = r.to_h
|
||||
prefix = r.delete(:prefix)
|
||||
if prefix
|
||||
r[:filter] = { prefix: prefix }
|
||||
end
|
||||
r
|
||||
end
|
||||
|
||||
s3_resource.client.put_bucket_lifecycle_configuration(
|
||||
bucket: @s3_bucket_name,
|
||||
lifecycle_configuration: {
|
||||
|
Reference in New Issue
Block a user