Migrate to comeonin 4 and Cachex 3

Also fix some warning in the code and add a missing alias
This commit is contained in:
Thog 2018-05-20 18:05:34 +02:00
commit e55c6f311b
No known key found for this signature in database
GPG key ID: 0CD291558FAFDBC6
11 changed files with 42 additions and 48 deletions

View file

@ -33,19 +33,15 @@ defmodule Pleroma.Object do
else
key = "object:#{ap_id}"
Cachex.get!(
:user_cache,
key,
fallback: fn _ ->
object = get_by_ap_id(ap_id)
Cachex.fetch!(:user_cache, key, fn _ ->
object = get_by_ap_id(ap_id)
if object do
{:commit, object}
else
{:ignore, object}
end
if object do
{:commit, object}
else
{:ignore, object}
end
)
end)
end
end