# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.ReverseProxy do
@failed_request_ttl :timer.seconds(60)
@methods ~w(GET HEAD)
+ @cachex Pleroma.Config.get([:cachex, :provider], Cachex)
+
def max_read_duration_default, do: @max_read_duration
def default_cache_control_header, do: @default_cache_control_header
opts
end
- with {:ok, nil} <- Cachex.get(:failed_proxy_url_cache, url),
+ with {:ok, nil} <- @cachex.get(:failed_proxy_url_cache, url),
{:ok, code, headers, client} <- request(method, url, req_headers, client_opts),
:ok <-
header_length_constraint(
nil
end
- Cachex.put(:failed_proxy_url_cache, url, true, ttl: ttl)
+ @cachex.put(:failed_proxy_url_cache, url, true, ttl: ttl)
end
end