mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 00:59:49 +01:00
Improve reliability of rebuilding the search index.
This commit is contained in:
committed by
Alex Hart
parent
6682815663
commit
1aed8eefcd
@@ -22,7 +22,14 @@ internal class RebuildMessageSearchIndexMigrationJob(
|
||||
|
||||
override fun performMigration() {
|
||||
val startTime = System.currentTimeMillis()
|
||||
SignalDatabase.messageSearch.rebuildIndex()
|
||||
|
||||
val success = SignalDatabase.messageSearch.rebuildIndex()
|
||||
|
||||
if (!success) {
|
||||
Log.w(TAG, "Failed to rebuild search index. Resetting tables. That will enqueue a job to reset the index as a side-effect.")
|
||||
SignalDatabase.messageSearch.fullyResetTables()
|
||||
}
|
||||
|
||||
Log.d(TAG, "It took ${System.currentTimeMillis() - startTime} ms to rebuild the search index.")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user