Add and fix tests

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-03-05 10:13:19 +01:00
parent 6de839dec2
commit 9a60704ed9
8 changed files with 55 additions and 17 deletions

View File

@@ -1028,9 +1028,9 @@ defmodule Mobilizon.Events do
end
end
def get_cached_comment_full_by_uuid("comment_" <> uuid) do
def get_cached_comment_full_by_uuid(uuid) do
Cachex.fetch(:activity_pub, "comment_" <> uuid, fn "comment_" <> uuid ->
with %Comment{} = comment <- Events.get_comment_full_from_uuid(uuid) do
with %Comment{} = comment <- get_comment_full_from_uuid(uuid) do
{:commit, comment}
else
_ -> {:ignore, nil}