Skip to content

Commit

Permalink
MB-24907 Revert "MB-24881 temporary disable user caches on ns_coushdb…
Browse files Browse the repository at this point in the history
… node"

This reverts commit a1be437.

Change-Id: I63b6284978e5b50c3b0b177e691a142753be46b5
Reviewed-on: http://review.couchbase.org/79699
Tested-by: Artem Stemkovski <artem@couchbase.com>
Reviewed-by: Ajit Yagaty <ajit.yagaty@couchbase.com>
  • Loading branch information
vzasade authored and ajityagaty committed Jun 24, 2017
1 parent aef83c1 commit 09de2c2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 6 additions & 0 deletions deps/ns_couchdb/src/ns_couchdb_sup.erl
Expand Up @@ -46,6 +46,9 @@ init([]) ->

child_specs() ->
[
{menelaus_users_auth_cache, {menelaus_users, start_auth_cache, []},
permanent, 1000, worker, [versioned_cache]},

{cb_couch_sup, {cb_couch_sup, start_link, []},
permanent, 5000, supervisor, [cb_couch_sup]},

Expand All @@ -70,6 +73,9 @@ child_specs() ->
permanent, infinity, supervisor,
[ns_couchdb_config_sup]},

{compiled_roles_cache, {menelaus_roles, start_compiled_roles_cache, []},
permanent, 1000, worker, [versioned_cache]},

{request_throttler, {request_throttler, start_link, []},
permanent, 1000, worker, [request_throttler]},

Expand Down
7 changes: 1 addition & 6 deletions src/menelaus_roles.erl
Expand Up @@ -532,12 +532,7 @@ start_compiled_roles_cache() ->

-spec get_compiled_roles(rbac_identity()) -> [rbac_compiled_role()].
get_compiled_roles(Identity) ->
case ns_node_disco:couchdb_node() == node() of
false ->
versioned_cache:get(compiled_roles_cache_name(), Identity);
true ->
rpc:call(ns_node_disco:ns_server_node(), ?MODULE, get_compiled_roles, [Identity])
end.
versioned_cache:get(compiled_roles_cache_name(), Identity).

build_compiled_roles(Identity) ->
case ns_node_disco:couchdb_node() == node() of
Expand Down
3 changes: 1 addition & 2 deletions src/menelaus_users.erl
Expand Up @@ -385,8 +385,7 @@ get_auth_info(Identity) ->
false ->
get_auth_info_on_ns_server(Identity);
true ->
rpc:call(ns_node_disco:ns_server_node(), ?MODULE, get_auth_info_on_ns_server,
[Identity])
versioned_cache:get(auth_cache_name(), Identity)
end.

get_auth_info_on_ns_server(Identity) ->
Expand Down

0 comments on commit 09de2c2

Please sign in to comment.