logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: f66a15c4a51e1c8f614b4c1609b2385a29762931
parent 2937e3095ab9208b2aea1f42792ab99b1b4252d7
Author: rinpatch <rinpatch@sdf.org>
Date:   Mon, 14 Sep 2020 14:44:25 +0300

RichMedia parser: do not set a cache TTL for unchanging errors

Diffstat:

Mlib/pleroma/web/rich_media/parser.ex8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/lib/pleroma/web/rich_media/parser.ex b/lib/pleroma/web/rich_media/parser.ex @@ -36,6 +36,14 @@ defmodule Pleroma.Web.RichMedia.Parser do {:ok, _data} = res -> res + {:error, :body_too_large} = e -> + e + + {:error, {:content_type, _}} -> + e + + # The TTL is not set for the errors above, since they are unlikely to change + # with time {:error, _} = e -> ttl = Pleroma.Config.get([:rich_media, :failure_backoff], 60_000) Cachex.expire(:rich_media_cache, url, ttl)