Delete just sends back ok for success

This commit is contained in:
Gregory Burd 2011-12-01 08:13:45 -05:00
parent ea7c83b32c
commit 63eb48ec24

View file

@ -977,7 +977,7 @@ get_r(Db, Key, Opts) ->
%% This function will return `not_found' if the specified key is not in %% This function will return `not_found' if the specified key is not in
%% the database. %% the database.
%% %%
%% @spec del(Db, Key) -> not_found | {ok, Value} | {error, Error} %% @spec del(Db, Key) -> ok | not_found | {error, Reason}
%% where %% where
%% Db = integer() %% Db = integer()
%% Key = term() %% Key = term()
@ -986,7 +986,7 @@ get_r(Db, Key, Opts) ->
%% @end %% @end
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
-spec del(Db :: db(), Key :: db_key()) -> -spec del(Db :: db(), Key :: db_key()) ->
not_found | ok | db_error(). ok | not_found | {error, Reason :: db_error()}.
del(Db, Key) -> del(Db, Key) ->
{KeyLen, KeyBin} = to_binary(Key), {KeyLen, KeyBin} = to_binary(Key),
@ -995,7 +995,7 @@ del(Db, Key) ->
case decode_rc(Result) of case decode_rc(Result) of
ok -> ok ->
receive receive
{ok, _, _} -> ok; ok -> ok;
not_found -> not_found; not_found -> not_found;
{error, Reason} -> {error, Reason} {error, Reason} -> {error, Reason}
end; end;