From ce05271870a251a1553e6ee3fb465c353d1bcfef Mon Sep 17 00:00:00 2001 From: Mac Siri Date: Tue, 15 Nov 2022 14:06:55 -0500 Subject: [PATCH] Use HTTParty for fastly_purge (#18731) --- app/services/edge_cache/bust/fastly.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/services/edge_cache/bust/fastly.rb b/app/services/edge_cache/bust/fastly.rb index 3b4985e58..a75c1653a 100644 --- a/app/services/edge_cache/bust/fastly.rb +++ b/app/services/edge_cache/bust/fastly.rb @@ -9,10 +9,8 @@ module EdgeCache end def self.fastly_purge(api_key, path) - fastly = ::Fastly.new(api_key: api_key) - urls(path).map do |url| - fastly.purge(url) + HTTParty.post("https://api.fastly.com/purge/#{url}", headers: { "Fastly-Key" => api_key }) end end private_class_method :fastly_purge @@ -23,7 +21,7 @@ module EdgeCache URL.url("#{path}?i=i"), ] end - private_class_method :fastly_purge + private_class_method :urls end end end