add service for purging files from cloudflare cache

This commit is contained in:
r888888888
2017-11-22 13:19:30 -08:00
parent 3e6cb67c57
commit 060762defa
3 changed files with 68 additions and 0 deletions

View File

@@ -89,6 +89,11 @@ class Post < ApplicationRecord
RemoteFileManager.new(file_path).delete
RemoteFileManager.new(large_file_path).delete
RemoteFileManager.new(preview_file_path).delete
if Danbooru.config.cloudflare_key
md5, ext = File.basename(file_path).split(".")
CloudflareService.new.delete(md5, ext)
end
end
end