Skip to content

let on_delete() return false to skip deletion#1

Open
edam wants to merge 1 commit into
moonlibs:masterfrom
edam:delete-skip
Open

let on_delete() return false to skip deletion#1
edam wants to merge 1 commit into
moonlibs:masterfrom
edam:delete-skip

Conversation

@edam
Copy link
Copy Markdown

@edam edam commented Jul 1, 2020

When the on_delete() function returns false, the library skips the deletion of the row.

Returning true (or nil) causes the row to be deleted as normal, so this change has no effect on existing code.

Note that when an row is not deleted, it will ordinarily retain its position in the index and be a candidate for deletion on the next pass. Therefore, user should be warned that if they return false from on_delete(), then they must either:
a. modify the expiration field (to prolong the row from expiry),
b. delete the row themselves, or
a. expect another deletion attempt immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant