mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Prevent "uploads are missing in S3" alerts after restoring a backup
After restoring a backup it takes up to 48 hours for uploads stored on S3 to appear in the S3 inventory. This change prevents alerts about missing uploads by preventing the EnsureS3UploadsExistence job from running in the first 48 hours after a restore. During the restore it deletes the count of missing uploads from the PluginStore, so that an alert isn't triggered by an old number.
This commit is contained in:
@@ -249,20 +249,14 @@ describe BackupRestore::DatabaseRestorer do
|
||||
|
||||
it "drops the schema when the last restore was long ago" do
|
||||
ActiveRecord::Base.connection.expects(:drop_schema).with("backup")
|
||||
|
||||
freeze_time(8.days.ago) do
|
||||
subject.update_last_restore_date
|
||||
end
|
||||
BackupMetadata.update_last_restore_date(8.days.ago)
|
||||
|
||||
subject.drop_backup_schema
|
||||
end
|
||||
|
||||
it "doesn't drop the schema when the last restore was recently" do
|
||||
ActiveRecord::Base.connection.expects(:drop_schema).with("backup").never
|
||||
|
||||
freeze_time(6.days.ago) do
|
||||
subject.update_last_restore_date
|
||||
end
|
||||
BackupMetadata.update_last_restore_date(6.days.ago)
|
||||
|
||||
subject.drop_backup_schema
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user