Skip to content

Commit

Permalink
Don't run FTS optimize job (for now).
Browse files Browse the repository at this point in the history
  • Loading branch information
greyson-signal committed Jan 30, 2023
1 parent 7275b95 commit 30b58fe
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package org.thoughtcrime.securesms.jobs

import org.thoughtcrime.securesms.database.SignalDatabase
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies
import org.thoughtcrime.securesms.jobmanager.Data
import org.thoughtcrime.securesms.jobmanager.Job
import org.thoughtcrime.securesms.transport.RetryLaterException
import java.lang.Exception
import kotlin.time.Duration.Companion.minutes
import kotlin.time.Duration.Companion.seconds

/**
* Optimizes the message search index incrementally.
Expand All @@ -19,7 +16,8 @@ class OptimizeMessageSearchIndexJob private constructor(parameters: Parameters)

@JvmStatic
fun enqueue() {
ApplicationDependencies.getJobManager().add(OptimizeMessageSearchIndexJob())
// TODO [greyson] Temporarily disabled until we can figure out what to do.
// ApplicationDependencies.getJobManager().add(OptimizeMessageSearchIndexJob())
}
}

Expand All @@ -38,11 +36,12 @@ class OptimizeMessageSearchIndexJob private constructor(parameters: Parameters)
override fun getNextRunAttemptBackoff(pastAttemptCount: Int, exception: Exception): Long = 1.minutes.inWholeMilliseconds

override fun onRun() {
val success = SignalDatabase.messageSearch.optimizeIndex(10.seconds.inWholeMilliseconds)

if (!success) {
throw RetryLaterException()
}
// TODO [greyson] Temporarily disabled until we can figure out what to do.
// val success = SignalDatabase.messageSearch.optimizeIndex(10.seconds.inWholeMilliseconds)
//
// if (!success) {
// throw RetryLaterException()
// }
}

class Factory : Job.Factory<OptimizeMessageSearchIndexJob> {
Expand Down

0 comments on commit 30b58fe

Please sign in to comment.