de-terminate bookie
This commit is contained in:
parent
11ba7029aa
commit
bb752f1025
1 changed files with 16 additions and 16 deletions
|
@ -742,6 +742,20 @@ handle_call(trim, _From, State) when State#state.head_only == true ->
|
||||||
PSQN = leveled_penciller:pcl_persistedsqn(State#state.penciller),
|
PSQN = leveled_penciller:pcl_persistedsqn(State#state.penciller),
|
||||||
{reply, leveled_inker:ink_trim(State#state.inker, PSQN), State};
|
{reply, leveled_inker:ink_trim(State#state.inker, PSQN), State};
|
||||||
handle_call(close, _From, State) ->
|
handle_call(close, _From, State) ->
|
||||||
|
ok =
|
||||||
|
case is_process_alive(State#state.inker) of
|
||||||
|
true ->
|
||||||
|
leveled_inker:ink_close(State#state.inker);
|
||||||
|
false ->
|
||||||
|
ok
|
||||||
|
end,
|
||||||
|
ok =
|
||||||
|
case is_process_alive(State#state.penciller) of
|
||||||
|
true ->
|
||||||
|
leveled_penciller:pcl_close(State#state.penciller);
|
||||||
|
false ->
|
||||||
|
ok
|
||||||
|
end,
|
||||||
{stop, normal, ok, State};
|
{stop, normal, ok, State};
|
||||||
handle_call(destroy, _From, State=#state{is_snapshot=Snp}) when Snp == false ->
|
handle_call(destroy, _From, State=#state{is_snapshot=Snp}) when Snp == false ->
|
||||||
leveled_log:log("B0011", []),
|
leveled_log:log("B0011", []),
|
||||||
|
@ -759,22 +773,8 @@ handle_cast(_Msg, State) ->
|
||||||
handle_info(_Info, State) ->
|
handle_info(_Info, State) ->
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
terminate(Reason, State) ->
|
terminate(Reason, _State) ->
|
||||||
leveled_log:log("B0003", [Reason]),
|
leveled_log:log("B0003", [Reason]).
|
||||||
ok =
|
|
||||||
case is_process_alive(State#state.inker) of
|
|
||||||
true ->
|
|
||||||
leveled_inker:ink_close(State#state.inker);
|
|
||||||
false ->
|
|
||||||
ok
|
|
||||||
end,
|
|
||||||
ok =
|
|
||||||
case is_process_alive(State#state.penciller) of
|
|
||||||
true ->
|
|
||||||
leveled_penciller:pcl_close(State#state.penciller);
|
|
||||||
false ->
|
|
||||||
ok
|
|
||||||
end.
|
|
||||||
|
|
||||||
code_change(_OldVsn, State, _Extra) ->
|
code_change(_OldVsn, State, _Extra) ->
|
||||||
{ok, State}.
|
{ok, State}.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue