Stop unncessary handling of pending_delete in test

This commit is contained in:
martinsumner 2016-11-08 00:44:51 +00:00
parent 105d3b66f2
commit 6f0abea401

View file

@ -178,6 +178,7 @@ cdb_destroy(Pid) ->
gen_fsm:send_event(Pid, destroy). gen_fsm:send_event(Pid, destroy).
cdb_deletepending(Pid) -> cdb_deletepending(Pid) ->
% Only used in unit tests
cdb_deletepending(Pid, 0, no_poll). cdb_deletepending(Pid, 0, no_poll).
cdb_deletepending(Pid, ManSQN, Inker) -> cdb_deletepending(Pid, ManSQN, Inker) ->
@ -437,28 +438,21 @@ delete_pending({key_check, Key}, _From, State) ->
State, State,
?DELETE_TIMEOUT}. ?DELETE_TIMEOUT}.
delete_pending(timeout, State) -> delete_pending(timeout, State=#state(delete_point=ManSQN) when ManSQN > 0 ->
case State#state.delete_point of case is_process_alive(State#state.inker) of
0 -> true ->
{next_state, delete_pending, State}; case leveled_inker:ink_confirmdelete(State#state.inker, ManSQN) of
ManSQN ->
case is_process_alive(State#state.inker) of
true -> true ->
case leveled_inker:ink_confirmdelete(State#state.inker, leveled_log:log("CDB04", [State#state.filename, ManSQN]),
ManSQN) of {stop, normal, State};
true ->
leveled_log:log("CDB04", [State#state.filename,
ManSQN]),
{stop, normal, State};
false ->
{next_state,
delete_pending,
State,
?DELETE_TIMEOUT}
end;
false -> false ->
{stop, normal, State} {next_state,
end delete_pending,
State,
?DELETE_TIMEOUT}
end;
false ->
{stop, normal, State}
end; end;
delete_pending(destroy, State) -> delete_pending(destroy, State) ->
ok = file:close(State#state.handle), ok = file:close(State#state.handle),