projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a767930
)
Add a fallback function to handle generic params, just in case
author
rinpatch
<rinpatch@sdf.org>
Wed, 16 Jan 2019 07:38:42 +0000
(10:38 +0300)
committer
rinpatch
<rinpatch@sdf.org>
Wed, 16 Jan 2019 07:38:42 +0000
(10:38 +0300)
lib/pleroma/web/metadata.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/web/metadata.ex
b/lib/pleroma/web/metadata.ex
index bc0f3beed268802128f345e1120acd10716ecb6b..23f152e068ca5cffd29e83f4a7c5769a0060203e 100644
(file)
--- a/
lib/pleroma/web/metadata.ex
+++ b/
lib/pleroma/web/metadata.ex
@@
-20,6
+20,14
@@
defmodule Pleroma.Web.Metadata do
end)
end
+ def get_cached_tags(params) do
+ key = :erlang.term_to_binary(params)
+
+ Cachex.fetch!(:metadata_cache, key, fn _key ->
+ {:commit, build_tags(params)}
+ end)
+ end
+
def build_tags(params) do
Enum.reduce(@parsers, "", fn parser, acc ->
rendered_html =