logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 50abb54d15bb52c510ccacadc6a76c38455cc39c
parent 4d3c2fb21b2ec1a80d6a3076f1044f572dfcc4c6
Author: lain <lain@soykaf.club>
Date:   Thu,  9 Feb 2023 19:09:54 +0000

Merge branch 'fix-relme' into 'develop'

Fix rel="me"

See merge request pleroma/pleroma!3824

Diffstat:

MCHANGELOG.md2++
Mlib/pleroma/application.ex3++-
Mlib/pleroma/web/rel_me.ex18+++++++-----------
3 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -12,6 +12,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed +- rel="me" was missing its cache + ### Removed ## 2.5.0 - 2022-12-23 diff --git a/lib/pleroma/application.ex b/lib/pleroma/application.ex @@ -209,7 +209,8 @@ defmodule Pleroma.Application do build_cachex("chat_message_id_idempotency_key", expiration: chat_message_id_idempotency_key_expiration(), limit: 500_000 - ) + ), + build_cachex("rel_me", limit: 2500) ] end diff --git a/lib/pleroma/web/rel_me.ex b/lib/pleroma/web/rel_me.ex @@ -9,17 +9,13 @@ defmodule Pleroma.Web.RelMe do 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) - def parse(url) when is_binary(url) do - @cachex.fetch!(:rel_me_cache, url, fn _ -> - {:commit, parse_url(url)} - end) - rescue - e -> {:error, "Cachex error: #{inspect(e)}"} - end + @cachex Pleroma.Config.get([:cachex, :provider], Cachex) + def parse(url) when is_binary(url) do + @cachex.fetch!(:rel_me_cache, url, fn _ -> + {:commit, parse_url(url)} + end) + rescue + e -> {:error, "Cachex error: #{inspect(e)}"} end def parse(_), do: {:error, "No URL provided"}