@@ -2,4 +2,8 @@ class BackupService
|
|||||||
def backup(file_path, options = {})
|
def backup(file_path, options = {})
|
||||||
raise NotImplementedError.new("#{self.class}.backup not implemented")
|
raise NotImplementedError.new("#{self.class}.backup not implemented")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def delete(file_path, options = {})
|
||||||
|
raise NotImplementedError.new("#{self.class}.delete not implemented")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,4 +2,8 @@ class NullBackupService
|
|||||||
def backup(file_path, options = {})
|
def backup(file_path, options = {})
|
||||||
# do nothing
|
# do nothing
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def delete(file_path, options = {})
|
||||||
|
# do nothing
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ class Post < ApplicationRecord
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
backup_service = Danbooru.config.backup_service
|
||||||
backup_service.delete(file_path, type: :original)
|
backup_service.delete(file_path, type: :original)
|
||||||
backup_service.delete(large_file_path, type: :large)
|
backup_service.delete(large_file_path, type: :large)
|
||||||
backup_service.delete(preview_file_path, type: :preview)
|
backup_service.delete(preview_file_path, type: :preview)
|
||||||
|
|||||||
Reference in New Issue
Block a user