projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[#3213] Performance-related stat in HashtagsTableMigrator. Reworked `count/_` to...
[akkoma]
/
lib
/
pleroma
/
reverse_proxy.ex
diff --git
a/lib/pleroma/reverse_proxy.ex
b/lib/pleroma/reverse_proxy.ex
index 8ae1157df1630f41e90c647de7028c6bcc27ad7a..466906f035dff1bd714fb360d507816dab4f061d 100644
(file)
--- a/
lib/pleroma/reverse_proxy.ex
+++ b/
lib/pleroma/reverse_proxy.ex
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-202
0
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-202
1
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.ReverseProxy do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.ReverseProxy do
@@
-17,6
+17,8
@@
defmodule Pleroma.ReverseProxy do
@failed_request_ttl :timer.seconds(60)
@methods ~w(GET HEAD)
@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
def max_read_duration_default, do: @max_read_duration
def default_cache_control_header, do: @default_cache_control_header
@@
-107,7
+109,7
@@
defmodule Pleroma.ReverseProxy do
opts
end
opts
end
- with {:ok, nil} <-
C
achex.get(:failed_proxy_url_cache, url),
+ with {:ok, nil} <-
@c
achex.get(:failed_proxy_url_cache, url),
{:ok, code, headers, client} <- request(method, url, req_headers, client_opts),
:ok <-
header_length_constraint(
{:ok, code, headers, client} <- request(method, url, req_headers, client_opts),
:ok <-
header_length_constraint(
@@
-427,6
+429,6
@@
defmodule Pleroma.ReverseProxy do
nil
end
nil
end
-
C
achex.put(:failed_proxy_url_cache, url, true, ttl: ttl)
+
@c
achex.put(:failed_proxy_url_cache, url, true, ttl: ttl)
end
end
end
end