mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 20:48:43 +00:00
Revert "Don't run FTS optimize job (for now)."
This reverts commit f26b2c0b2a.
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
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
|
||||||
@@ -16,8 +18,7 @@ class OptimizeMessageSearchIndexJob private constructor(parameters: Parameters)
|
|||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun enqueue() {
|
fun enqueue() {
|
||||||
// TODO [greyson] Temporarily disabled until we can figure out what to do.
|
ApplicationDependencies.getJobManager().add(OptimizeMessageSearchIndexJob())
|
||||||
// ApplicationDependencies.getJobManager().add(OptimizeMessageSearchIndexJob())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,12 +37,11 @@ class OptimizeMessageSearchIndexJob private constructor(parameters: Parameters)
|
|||||||
override fun getNextRunAttemptBackoff(pastAttemptCount: Int, exception: Exception): Long = 30.seconds.inWholeMilliseconds
|
override fun getNextRunAttemptBackoff(pastAttemptCount: Int, exception: Exception): Long = 30.seconds.inWholeMilliseconds
|
||||||
|
|
||||||
override fun onRun() {
|
override fun onRun() {
|
||||||
// TODO [greyson] Temporarily disabled until we can figure out what to do.
|
val success = SignalDatabase.messageSearch.optimizeIndex(5.seconds.inWholeMilliseconds)
|
||||||
// val success = SignalDatabase.messageSearch.optimizeIndex(5.seconds.inWholeMilliseconds)
|
|
||||||
//
|
if (!success) {
|
||||||
// if (!success) {
|
throw RetryLaterException()
|
||||||
// throw RetryLaterException()
|
}
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class Factory : Job.Factory<OptimizeMessageSearchIndexJob> {
|
class Factory : Job.Factory<OptimizeMessageSearchIndexJob> {
|
||||||
|
|||||||
Reference in New Issue
Block a user