mirror of
https://codeberg.org/NextPush/nextpush-android.git
synced 2025-01-06 23:41:34 +01:00
Lint RestartWorker.clean
This commit is contained in:
parent
c9d4e2fd13
commit
ef7d50cdbf
@ -36,16 +36,16 @@ class RestartWorker(ctx: Context, params: WorkerParameters) : Worker(ctx, params
|
||||
companion object {
|
||||
fun start(context: Context, delay: Long? = null) {
|
||||
val work = PeriodicWorkRequestBuilder<RestartWorker>(16, TimeUnit.MINUTES)
|
||||
if (delay != null) {
|
||||
delay?.let {
|
||||
lastEventDate = null
|
||||
work.setInitialDelay(delay, TimeUnit.SECONDS)
|
||||
work.setInitialDelay(it, TimeUnit.SECONDS)
|
||||
}
|
||||
val workManager = WorkManager.getInstance(context)
|
||||
workManager.enqueueUniquePeriodicWork(
|
||||
UNIQUE_WORK_TAG,
|
||||
ExistingPeriodicWorkPolicy.REPLACE,
|
||||
work.build()
|
||||
)
|
||||
WorkManager.getInstance(context)
|
||||
.enqueueUniquePeriodicWork(
|
||||
UNIQUE_WORK_TAG,
|
||||
ExistingPeriodicWorkPolicy.REPLACE,
|
||||
work.build()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user