projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2937e30
)
RichMedia parser: do not set a cache TTL for unchanging errors
author
rinpatch
<rinpatch@sdf.org>
Mon, 14 Sep 2020 11:44:25 +0000
(14:44 +0300)
committer
rinpatch
<rinpatch@sdf.org>
Mon, 14 Sep 2020 11:44:25 +0000
(14:44 +0300)
lib/pleroma/web/rich_media/parser.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/web/rich_media/parser.ex
b/lib/pleroma/web/rich_media/parser.ex
index 5727fda189bf39f4ac501461504ff247f1f86fa7..ab8f359223d97a29a59b0f192f46da66b69c8091 100644
(file)
--- 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)