refactor: OpenGroupPollerV2.kt no longer queues jobs and executes synchronously, BackgroundPollWorker.kt no longer replaces periodic tasks but keeps existing ones, removing unused references

This commit is contained in:
jubb
2021-07-15 12:00:30 +10:00
parent 3928a799fb
commit 5f7278b9c4
4 changed files with 10 additions and 23 deletions

View File

@@ -25,12 +25,12 @@ class BackgroundPollWorker(val context: Context, params: WorkerParameters) : Wor
@JvmStatic
fun schedulePeriodic(context: Context) {
Log.v(TAG, "Scheduling periodic work.")
val builder = PeriodicWorkRequestBuilder<BackgroundPollWorker>(5, TimeUnit.MINUTES)
val builder = PeriodicWorkRequestBuilder<BackgroundPollWorker>(15, TimeUnit.MINUTES)
builder.setConstraints(Constraints.Builder().setRequiredNetworkType(NetworkType.CONNECTED).build())
val workRequest = builder.build()
WorkManager.getInstance(context).enqueueUniquePeriodicWork(
TAG,
ExistingPeriodicWorkPolicy.REPLACE,
ExistingPeriodicWorkPolicy.KEEP,
workRequest
)
}