updated docs

This commit is contained in:
Maksim Pechnikov 2020-05-18 06:48:19 +03:00
commit c33a4315fb
4 changed files with 27 additions and 9 deletions

View file

@ -10,8 +10,9 @@ defmodule Pleroma.Web.MediaProxy.Invalidation do
end
defp do_purge(true, urls) do
config = Config.get([:media_proxy, :invalidation])
config[:provider].purge(urls, config[:options])
provider = Config.get([:media_proxy, :invalidation, :provider])
options = Config.get(provider)
provider.purge(urls, options)
:ok
end

View file

@ -3,9 +3,9 @@ defmodule Pleroma.Web.MediaProxy.Invalidation.Http do
@impl Pleroma.Web.MediaProxy.Invalidation
def purge(urls, opts) do
method = Map.get(opts, :http_method, :purge)
headers = Map.get(opts, :http_headers, [])
options = Map.get(opts, :http_options, [])
method = Map.get(opts, :method, :purge)
headers = Map.get(opts, :headers, [])
options = Map.get(opts, :options, [])
Enum.each(urls, fn url ->
Pleroma.HTTP.request(method, url, "", headers, options)