Merge branch 'fix-relme' into 'develop'

Fix rel="me"

See merge request pleroma/pleroma!3824
This commit is contained in:
lain 2023-02-09 19:09:54 +00:00
commit 50abb54d15
3 changed files with 11 additions and 12 deletions

View File

@ -12,6 +12,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed ### Fixed
- rel="me" was missing its cache
### Removed ### Removed
## 2.5.0 - 2022-12-23 ## 2.5.0 - 2022-12-23

View File

@ -209,7 +209,8 @@ defp cachex_children do
build_cachex("chat_message_id_idempotency_key", build_cachex("chat_message_id_idempotency_key",
expiration: chat_message_id_idempotency_key_expiration(), expiration: chat_message_id_idempotency_key_expiration(),
limit: 500_000 limit: 500_000
) ),
build_cachex("rel_me", limit: 2500)
] ]
end end

View File

@ -9,9 +9,6 @@ defmodule Pleroma.Web.RelMe do
recv_timeout: 2_000 recv_timeout: 2_000
] ]
if Pleroma.Config.get(:env) == :test do
def parse(url) when is_binary(url), do: parse_url(url)
else
@cachex Pleroma.Config.get([:cachex, :provider], Cachex) @cachex Pleroma.Config.get([:cachex, :provider], Cachex)
def parse(url) when is_binary(url) do def parse(url) when is_binary(url) do
@cachex.fetch!(:rel_me_cache, url, fn _ -> @cachex.fetch!(:rel_me_cache, url, fn _ ->
@ -20,7 +17,6 @@ def parse(url) when is_binary(url) do
rescue rescue
e -> {:error, "Cachex error: #{inspect(e)}"} e -> {:error, "Cachex error: #{inspect(e)}"}
end end
end
def parse(_), do: {:error, "No URL provided"} def parse(_), do: {:error, "No URL provided"}