From a9c27e137d992c991827417af40fe49fafa34be2 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Wed, 16 Jan 2019 10:38:42 +0300 Subject: [PATCH] Add a fallback function to handle generic params, just in case --- lib/pleroma/web/metadata.ex | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/pleroma/web/metadata.ex b/lib/pleroma/web/metadata.ex index bc0f3beed..23f152e06 100644 --- 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 = -- 2.45.2