mirror of https://github.com/tasks/tasks
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
614 B
Kotlin
24 lines
614 B
Kotlin
package org.tasks.jobs
|
|
|
|
import android.content.Context
|
|
import androidx.work.WorkerParameters
|
|
import kotlinx.coroutines.runBlocking
|
|
import org.tasks.analytics.Firebase
|
|
import org.tasks.injection.BaseWorker
|
|
|
|
abstract class RepeatingWorker internal constructor(
|
|
context: Context,
|
|
workerParams: WorkerParameters,
|
|
firebase: Firebase
|
|
) : BaseWorker(context, workerParams, firebase) {
|
|
|
|
override fun doWork(): Result {
|
|
val result = super.doWork()
|
|
runBlocking {
|
|
scheduleNext()
|
|
}
|
|
return result
|
|
}
|
|
|
|
protected abstract suspend fun scheduleNext()
|
|
} |