From fee1c65a1249cfdf535dc05ad0e5f23cf28458c4 Mon Sep 17 00:00:00 2001 From: alperozturk Date: Wed, 13 Nov 2024 16:35:29 +0100 Subject: [PATCH] add initial delay Signed-off-by: alperozturk --- .../com/nextcloud/client/jobs/BackgroundJobManagerImpl.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/nextcloud/client/jobs/BackgroundJobManagerImpl.kt b/app/src/main/java/com/nextcloud/client/jobs/BackgroundJobManagerImpl.kt index c520c212cb70..9fadd964db8f 100644 --- a/app/src/main/java/com/nextcloud/client/jobs/BackgroundJobManagerImpl.kt +++ b/app/src/main/java/com/nextcloud/client/jobs/BackgroundJobManagerImpl.kt @@ -663,7 +663,9 @@ internal class BackgroundJobManagerImpl( jobClass = InternalTwoWaySyncWork::class, jobName = JOB_INTERNAL_TWO_WAY_SYNC, intervalMins = intervalMinutes - ).build() + ) + .setInitialDelay(intervalMinutes, TimeUnit.MINUTES) + .build() workManager.enqueueUniquePeriodicWork(JOB_INTERNAL_TWO_WAY_SYNC, ExistingPeriodicWorkPolicy.UPDATE, request) }