mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-10 10:09:02 +00:00
Don't commit nil values in object cache.
This commit is contained in:
parent
3cb518270a
commit
108573265a
|
@ -19,7 +19,14 @@ defmodule Pleroma.Object do
|
||||||
get_by_ap_id(ap_id)
|
get_by_ap_id(ap_id)
|
||||||
else
|
else
|
||||||
key = "object:#{ap_id}"
|
key = "object:#{ap_id}"
|
||||||
Cachex.get!(:user_cache, key, fallback: fn(_) -> get_by_ap_id(ap_id) end)
|
Cachex.get!(:user_cache, key, fallback: fn(_) ->
|
||||||
|
object = get_by_ap_id(ap_id)
|
||||||
|
if object do
|
||||||
|
{:commit, object}
|
||||||
|
else
|
||||||
|
{:ignore, object}
|
||||||
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue