Simplify SnapSQN check
Less ugly
This commit is contained in:
parent
6e0bf7bce3
commit
6beeadc7d8
1 changed files with 7 additions and 10 deletions
|
@ -390,16 +390,13 @@ handle_call({register_snapshot, Requestor}, _From , State) ->
|
||||||
State#state.active_journaldb},
|
State#state.active_journaldb},
|
||||||
State#state{registered_snapshots=Rs}};
|
State#state{registered_snapshots=Rs}};
|
||||||
handle_call({confirm_delete, ManSQN}, _From, State) ->
|
handle_call({confirm_delete, ManSQN}, _From, State) ->
|
||||||
Reply = lists:foldl(fun({_R, SnapSQN}, Bool) ->
|
CheckSQNFun =
|
||||||
case SnapSQN >= ManSQN of
|
fun({_R, SnapSQN}, Bool) ->
|
||||||
true ->
|
(SnapSQN >= ManSQN) and Bool
|
||||||
Bool;
|
end,
|
||||||
false ->
|
{reply,
|
||||||
false
|
lists:foldl(CheckSQNFun, true, State#state.registered_snapshots),
|
||||||
end end,
|
State};
|
||||||
true,
|
|
||||||
State#state.registered_snapshots),
|
|
||||||
{reply, Reply, State};
|
|
||||||
handle_call(get_manifest, _From, State) ->
|
handle_call(get_manifest, _From, State) ->
|
||||||
{reply, leveled_imanifest:to_list(State#state.manifest), State};
|
{reply, leveled_imanifest:to_list(State#state.manifest), State};
|
||||||
handle_call({update_manifest,
|
handle_call({update_manifest,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue