25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

Don't ask other nodes to invalidate cache when the key is not updated

This commit is contained in:
Evgeniy Khramtsov 2018-02-18 09:02:23 +03:00
parent d5afc767e6
commit ff06bdf144

View File

@ -547,15 +547,15 @@ db_user_exists(User, Server, Mod) ->
error ->
case Mod:store_type(Server) of
external ->
case ets_cache:update(
?AUTH_CACHE, {User, Server}, {ok, exists},
case ets_cache:lookup(
?AUTH_CACHE, {User, Server},
fun() ->
case Mod:user_exists(User, Server) of
true -> {ok, exists};
false -> error;
{error, _} = Err -> Err
end
end, cache_nodes(Mod, Server)) of
end) of
{ok, _} ->
true;
error ->
@ -584,7 +584,7 @@ db_check_password(User, AuthzId, Server, ProvidedPassword,
false ->
error
end
end, cache_nodes(Mod, Server)) of
end) of
{ok, _} ->
true;
error ->