Skip to content

Commit

Permalink
Purge episode covers alongside episode
Browse files Browse the repository at this point in the history
  • Loading branch information
jerodsanto committed Feb 27, 2024
1 parent e213ba4 commit 5213d19
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/changelog/fastly.ex
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ defmodule Changelog.Fastly do
if episode.plusplus_file do
episode |> EpisodeView.plusplus_url() |> purge()
end

if episode.cover do
for version <- Files.Cover.__versions() do
episode |> EpisodeView.cover_url(version) |> purge()
end
end
end

def purge(metacast = %Metacast{}) do
Expand Down Expand Up @@ -140,6 +146,6 @@ defmodule Changelog.Fastly do
auth = Application.get_env(:changelog, :fastly_token)
%{path: path, host: host} = URI.parse(url)
Logger.info("Fastly: Purging #{url}")
HTTP.request(:purge, endpoint(path), "", [{"Host", host} , {"Fastly-Key", auth}])
HTTP.request(:purge, endpoint(path), "", [{"Host", host}, {"Fastly-Key", auth}])
end
end

0 comments on commit 5213d19

Please sign in to comment.