diff --git a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/session/SessionHandler.kt b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/session/SessionHandler.kt index eba5296b5e..34344006f8 100644 --- a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/session/SessionHandler.kt +++ b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/session/SessionHandler.kt @@ -544,7 +544,7 @@ internal class SessionHandler( } try { - this.automaticSessionStopper.scheduleAtFixedRate( + this.automaticSessionStopper.scheduleWithFixedDelay( automaticSessionStopperCallback, maxSessionSeconds.toLong(), maxSessionSeconds.toLong(), @@ -592,7 +592,7 @@ internal class SessionHandler( */ private fun startPeriodicCaching(cacheCallback: Runnable) { try { - scheduledFuture = this.sessionPeriodicCacheExecutorService.scheduleAtFixedRate( + scheduledFuture = this.sessionPeriodicCacheExecutorService.scheduleWithFixedDelay( cacheCallback, 0, SESSION_CACHING_INTERVAL.toLong(), diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/SessionHandlerTest.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/SessionHandlerTest.kt index 321b1df150..c52b3db147 100644 --- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/SessionHandlerTest.kt +++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/SessionHandlerTest.kt @@ -211,7 +211,7 @@ internal class SessionHandlerTest { assertEquals(1, gatingService.sessionMessagesFiltered.size) // verify automatic session stopper has been scheduled verify { - mockAutomaticSessionStopper.scheduleAtFixedRate( + mockAutomaticSessionStopper.scheduleWithFixedDelay( mockAutomaticSessionStopperRunnable, maxSessionSeconds.toLong(), maxSessionSeconds.toLong(), @@ -220,7 +220,7 @@ internal class SessionHandlerTest { } // verify periodic caching worker has been scheduled verify { - mockSessionPeriodicCacheExecutorService.scheduleAtFixedRate( + mockSessionPeriodicCacheExecutorService.scheduleWithFixedDelay( mockPeriodicCachingRunnable, 0, SESSION_CACHING_INTERVAL.toLong(),