mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 20:48:43 +00:00
Don't run FTS optimize job (for now).
This commit is contained in:
@@ -1,13 +1,10 @@
|
|||||||
package org.thoughtcrime.securesms.jobs
|
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.Data
|
||||||
import org.thoughtcrime.securesms.jobmanager.Job
|
import org.thoughtcrime.securesms.jobmanager.Job
|
||||||
import org.thoughtcrime.securesms.transport.RetryLaterException
|
import org.thoughtcrime.securesms.transport.RetryLaterException
|
||||||
import java.lang.Exception
|
import java.lang.Exception
|
||||||
import kotlin.time.Duration.Companion.minutes
|
import kotlin.time.Duration.Companion.minutes
|
||||||
import kotlin.time.Duration.Companion.seconds
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optimizes the message search index incrementally.
|
* Optimizes the message search index incrementally.
|
||||||
@@ -19,7 +16,8 @@ class OptimizeMessageSearchIndexJob private constructor(parameters: Parameters)
|
|||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun enqueue() {
|
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 getNextRunAttemptBackoff(pastAttemptCount: Int, exception: Exception): Long = 1.minutes.inWholeMilliseconds
|
||||||
|
|
||||||
override fun onRun() {
|
override fun onRun() {
|
||||||
val success = SignalDatabase.messageSearch.optimizeIndex(10.seconds.inWholeMilliseconds)
|
// TODO [greyson] Temporarily disabled until we can figure out what to do.
|
||||||
|
// val success = SignalDatabase.messageSearch.optimizeIndex(10.seconds.inWholeMilliseconds)
|
||||||
if (!success) {
|
//
|
||||||
throw RetryLaterException()
|
// if (!success) {
|
||||||
}
|
// throw RetryLaterException()
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
class Factory : Job.Factory<OptimizeMessageSearchIndexJob> {
|
class Factory : Job.Factory<OptimizeMessageSearchIndexJob> {
|
||||||
|
|||||||
Reference in New Issue
Block a user