From 28d3701f6e11c59b4787252e73fc04f575b5f779 Mon Sep 17 00:00:00 2001 From: Martin Sumner Date: Tue, 24 May 2022 09:53:27 +0100 Subject: [PATCH] Mas i370 deletepending (#378) * All confirmed deletions to complete when manifest is not lockable Previously if there was ongoing work (i.e. the clerk had control over the manifest), the penciller could not confirm deletions. Now it may confirm, and defer the required manifest update to a later date (prompted by another delete confirmation request). * Refactor to update manifest even without on return of manifest Rather than waiting on next delete confirmation request * Update src/leveled_pmanifest.erl Co-authored-by: Thomas Arts * Missing commit Co-authored-by: Thomas Arts --- src/leveled_penciller.erl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/leveled_penciller.erl b/src/leveled_penciller.erl index 96edb5f..9f0e298 100644 --- a/src/leveled_penciller.erl +++ b/src/leveled_penciller.erl @@ -1002,7 +1002,7 @@ handle_cast({manifest_change, Manifest}, State) -> UpdManifest1 = leveled_pmanifest:clear_pending( UpdManifest0, - State#state.pending_removals, + lists:usort(State#state.pending_removals), State#state.maybe_release), {noreply, State#state{ @@ -1038,11 +1038,10 @@ handle_cast({confirm_delete, PDFN, FilePid}, State=#state{is_snapshot=Snap}) ok = leveled_sst:sst_deleteconfirmed(FilePid), case State#state.work_ongoing of true -> - UpdRemovals = - lists:usort([PDFN|State#state.pending_removals]), {noreply, State#state{ - pending_removals = UpdRemovals}}; + pending_removals = + [PDFN|State#state.pending_removals]}}; false -> UpdManifest = leveled_pmanifest:clear_pending(