Use Default dispatcher instead of IO

pull/1061/head
Alex Baker 4 years ago
parent da256f2293
commit aa9e0e93b9

@ -14,7 +14,6 @@ import dagger.hilt.android.HiltAndroidApp
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.launch
import org.tasks.billing.BillingClient
import org.tasks.billing.Inventory
@ -72,7 +71,7 @@ class Tasks : Application(), Configuration.Provider {
}
}
private fun backgroundWork() = CoroutineScope(Dispatchers.IO + SupervisorJob()).launch {
private fun backgroundWork() = CoroutineScope(Dispatchers.Default).launch {
NotificationSchedulerIntentService.enqueueWork(context, false)
CalendarNotificationIntentService.enqueueWork(context)
refreshScheduler.get().scheduleAll()

@ -22,7 +22,7 @@ import javax.inject.Inject
@AndroidEntryPoint
class DashClockExtension : DashClockExtension() {
private val job = SupervisorJob()
private val scope = CoroutineScope(Dispatchers.IO + job)
private val scope = CoroutineScope(Dispatchers.Default + job)
@Inject lateinit var defaultFilterProvider: DefaultFilterProvider
@Inject lateinit var taskDao: TaskDao
@ -43,6 +43,7 @@ class DashClockExtension : DashClockExtension() {
override fun onDestroy() {
super.onDestroy()
localBroadcastManager.unregisterReceiver(refreshReceiver)
job.cancel()
}
override fun onUpdateData(i: Int) {

@ -15,7 +15,7 @@ import javax.inject.Inject
abstract class InjectingService : Service() {
private val job = SupervisorJob()
private val scope = CoroutineScope(Dispatchers.IO + job)
private val scope = CoroutineScope(Dispatchers.Default + job)
@Inject lateinit var firebase: Firebase

Loading…
Cancel
Save