From 18f16bc0450ae57bcb6228dd1a2e2824290f6b6d Mon Sep 17 00:00:00 2001 From: 0x330a <92654767+0x330a@users.noreply.github.com> Date: Thu, 4 May 2023 11:27:49 +1000 Subject: [PATCH] refactor: try to add a retry logic to config sync job in case of snode failure --- .../session/libsession/messaging/jobs/ConfigurationSyncJob.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsession/src/main/java/org/session/libsession/messaging/jobs/ConfigurationSyncJob.kt b/libsession/src/main/java/org/session/libsession/messaging/jobs/ConfigurationSyncJob.kt index c046658dfc..8ec7727c39 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/jobs/ConfigurationSyncJob.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/jobs/ConfigurationSyncJob.kt @@ -19,7 +19,7 @@ data class ConfigurationSyncJob(val destination: Destination): Job { override var delegate: JobDelegate? = null override var id: String? = null override var failureCount: Int = 0 - override val maxFailureCount: Int = 1 + override val maxFailureCount: Int = 10 val shouldRunAgain = AtomicBoolean(false) @@ -142,7 +142,7 @@ data class ConfigurationSyncJob(val destination: Destination): Job { } } catch (e: Exception) { Log.e(TAG, "Error performing batch request", e) - return delegate.handleJobFailedPermanently(this, dispatcherName, e) + return delegate.handleJobFailed(this, dispatcherName, e) } delegate.handleJobSucceeded(this, dispatcherName) if (shouldRunAgain.get() && storage.getConfigSyncJob(destination) == null) {