nickva commented on a change in pull request #756: Make couch_peruser a proper 
Erlang app
URL: https://github.com/apache/couchdb/pull/756#discussion_r143383871
 
 

 ##########
 File path: src/couch_peruser/src/couch_peruser.erl
 ##########
 @@ -76,31 +135,69 @@ init_changes_handler(#state{db_name=DbName} = State) ->
         ok
     end.
 
-changes_handler({change, {Doc}, _Prepend}, _ResType, State=#state{}) ->
+-type db_change() :: {atom(), tuple(), binary()}.
+-spec changes_handler(Change :: db_change(), ResultType :: any(), State :: 
#state{}) -> #state{}.
+changes_handler({change, {Doc}, _Prepend}, _ResType, 
State=#state{db_name=DbName}) ->
+    % couch_log:debug("peruser: changes_handler() on DbName/Doc ~p/~p", 
[DbName, Doc]),
+
     case couch_util:get_value(<<"id">>, Doc) of
-    <<"org.couchdb.user:",User/binary>> ->
-        case couch_util:get_value(<<"deleted">>, Doc, false) of
-        false ->
-            UserDb = ensure_user_db(User),
-            ok = ensure_security(User, UserDb, fun add_user/3),
-            State;
+    <<"org.couchdb.user:",User/binary>>=DocId ->
 
 Review comment:
   Space between >> and =
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to