Use HTTParty for fastly_purge (#18731)
This commit is contained in:
parent
422ad2a95a
commit
ce05271870
1 changed files with 2 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue