25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +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 -> error ->
case Mod:store_type(Server) of case Mod:store_type(Server) of
external -> external ->
case ets_cache:update( case ets_cache:lookup(
?AUTH_CACHE, {User, Server}, {ok, exists}, ?AUTH_CACHE, {User, Server},
fun() -> fun() ->
case Mod:user_exists(User, Server) of case Mod:user_exists(User, Server) of
true -> {ok, exists}; true -> {ok, exists};
false -> error; false -> error;
{error, _} = Err -> Err {error, _} = Err -> Err
end end
end, cache_nodes(Mod, Server)) of end) of
{ok, _} -> {ok, _} ->
true; true;
error -> error ->
@ -584,7 +584,7 @@ db_check_password(User, AuthzId, Server, ProvidedPassword,
false -> false ->
error error
end end
end, cache_nodes(Mod, Server)) of end) of
{ok, _} -> {ok, _} ->
true; true;
error -> error ->