1
0
mirror of https://github.com/nextcloud/talk-android synced 2025-03-12 18:40:52 +00:00

add flexinterval for PeriodicWorkRequests

so the actions are not triggered when PeriodicWorkRequests are created.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2022-01-20 11:02:06 +01:00
parent c8274fe740
commit 6f302c25c4
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B

View File

@ -86,8 +86,11 @@ class ClosedInterfaceImpl : ClosedInterface, ProviderInstaller.ProviderInstallLi
val data: Data = Data.Builder().putString(PushRegistrationWorker.ORIGIN, "ClosedInterfaceImpl#setUpPeriodicLocalTokenRegistration").build()
val periodicTokenRegistration = PeriodicWorkRequest.Builder(
PushRegistrationWorker::class.java, 1,
TimeUnit.DAYS
PushRegistrationWorker::class.java,
24,
TimeUnit.HOURS,
10,
TimeUnit.HOURS
)
.setInputData(data)
.build()
@ -101,8 +104,11 @@ class ClosedInterfaceImpl : ClosedInterface, ProviderInstaller.ProviderInstallLi
private fun setUpPeriodicTokenRefreshFromFCM() {
val periodicTokenRefreshFromFCM = PeriodicWorkRequest.Builder(
GetFirebasePushTokenWorker::class.java, 30,
TimeUnit.DAYS
GetFirebasePushTokenWorker::class.java,
30,
TimeUnit.DAYS,
10,
TimeUnit.DAYS,
)
.build()