Fix expunging posts from S3 (fixup 4c4ef5c / #3180).

This commit is contained in:
evazion
2017-07-01 12:19:04 -05:00
parent f8ed7d4357
commit 0390039621
3 changed files with 9 additions and 0 deletions

View File

@@ -2,4 +2,8 @@ class BackupService
def backup(file_path, options = {})
raise NotImplementedError.new("#{self.class}.backup not implemented")
end
def delete(file_path, options = {})
raise NotImplementedError.new("#{self.class}.delete not implemented")
end
end

View File

@@ -2,4 +2,8 @@ class NullBackupService
def backup(file_path, options = {})
# do nothing
end
def delete(file_path, options = {})
# do nothing
end
end

View File

@@ -74,6 +74,7 @@ class Post < ApplicationRecord
end
end
backup_service = Danbooru.config.backup_service
backup_service.delete(file_path, type: :original)
backup_service.delete(large_file_path, type: :large)
backup_service.delete(preview_file_path, type: :preview)