forked from AkkomaGang/akkoma
Fix the issue with get_by_nickname never being called
This commit is contained in:
parent
3b18789684
commit
388ceb6a7d
1 changed files with 7 additions and 2 deletions
|
@ -449,8 +449,13 @@ def get_cached_by_id(id) do
|
||||||
ap_id =
|
ap_id =
|
||||||
Cachex.fetch!(:user_cache, key, fn _ ->
|
Cachex.fetch!(:user_cache, key, fn _ ->
|
||||||
user = get_by_id(id)
|
user = get_by_id(id)
|
||||||
|
|
||||||
|
if user do
|
||||||
Cachex.put(:user_cache, "ap_id:#{user.ap_id}", user)
|
Cachex.put(:user_cache, "ap_id:#{user.ap_id}", user)
|
||||||
{:commit, user.ap_id}
|
{:commit, user.ap_id}
|
||||||
|
else
|
||||||
|
{:ignore, ""}
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
get_cached_by_ap_id(ap_id)
|
get_cached_by_ap_id(ap_id)
|
||||||
|
|
Loading…
Reference in a new issue