cloudflare: fix purging of cached urls.
* Switch CloudflareService from HttpartyCache to Danbooru::Http. * Purge cached urls from Cloudflare when a post is replaced and the md5 doesn't change. This happens when a corrupted image is replaced or thumbnails are regenerated. Before we purged urls when a post was expunged, which was unneeded because those urls can expire naturally. It was also wrong because the subdomains were hardcoded, the urls used http:// instead of https://, and we didn't account for tagged urls.
This commit is contained in:
@@ -77,10 +77,6 @@ class Post < ApplicationRecord
|
||||
Danbooru.config.backup_storage_manager.delete_file(post_id, md5, file_ext, :original)
|
||||
Danbooru.config.backup_storage_manager.delete_file(post_id, md5, file_ext, :large)
|
||||
Danbooru.config.backup_storage_manager.delete_file(post_id, md5, file_ext, :preview)
|
||||
|
||||
if Danbooru.config.cloudflare_key
|
||||
CloudflareService.new.delete(md5, file_ext)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user