Skip to content

Commit

Permalink
Merge pull request #4722 from basilgello/remove-fulltext-remnants
Browse files Browse the repository at this point in the history
Compact messages_fulltext table after messages destroyed
  • Loading branch information
cketti authored May 4, 2020
2 parents f62818b + 97c7b29 commit c26037c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/core/src/main/java/com/fsck/k9/mailstore/LocalFolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -1636,6 +1636,8 @@ private void destroyMessages(String messageSelection) throws MessagingException
}
}

compactFulltextEntries(db);

return null;
});
}
Expand Down Expand Up @@ -1824,6 +1826,10 @@ void deleteFulltextIndexEntry(SQLiteDatabase db, long messageId) {
db.delete("messages_fulltext", "docid = ?", idArg);
}

void compactFulltextEntries(SQLiteDatabase db) {
db.execSQL("INSERT INTO messages_fulltext(messages_fulltext) VALUES('optimize')");
}

void deleteMessagePartsAndDataFromDisk(final long rootMessagePartId) throws MessagingException {
deleteMessageDataFromDisk(rootMessagePartId);
deleteMessageParts(rootMessagePartId);
Expand Down

0 comments on commit c26037c

Please sign in to comment.