mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 04:19:05 +08:00
74d28a43d1
* DEV: new S3 backup layout Currently, with $S3_BACKUP_BUCKET of "bucket/backups", multisite backups end up in "bucket/backups/backups/dbname/" and single-site will be in "bucket/backups/". Both _should_ be in "bucket/backups/dbname/" - remove MULTISITE_PREFIX, - always include dbname, - method to move to the new prefix - job to call the method * SPEC: add tests for `VacateLegacyPrefixBackups` onceoff job. Co-authored-by: Vinoth Kannan <vinothkannan@vinkas.com>
11 lines
319 B
Ruby
11 lines
319 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Jobs
|
|
class VacateLegacyPrefixBackups < ::Jobs::Onceoff
|
|
def execute_onceoff(args)
|
|
args ||= {}
|
|
BackupRestore::S3BackupStore.create(s3_options: args[:s3_options]).vacate_legacy_prefix if SiteSetting.backup_location == BackupLocationSiteSetting::S3
|
|
end
|
|
end
|
|
end
|