updated docs
This commit is contained in:
parent
3f8d68bdf3
commit
c33a4315fb
4 changed files with 27 additions and 9 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue