kopia lustrzana https://github.com/ryukoposting/Signal-Android
Don't run FTS optimize job (for now).
rodzic
7275b95b58
commit
30b58fe5f4
|
@ -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.
|
||||
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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> {
|
||||
|
|
Ładowanie…
Reference in New Issue