mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-25 11:05:25 +00:00
refactor: try to add a retry logic to config sync job in case of snode failure
This commit is contained in:
parent
281b8dac33
commit
18f16bc045
@ -19,7 +19,7 @@ data class ConfigurationSyncJob(val destination: Destination): Job {
|
|||||||
override var delegate: JobDelegate? = null
|
override var delegate: JobDelegate? = null
|
||||||
override var id: String? = null
|
override var id: String? = null
|
||||||
override var failureCount: Int = 0
|
override var failureCount: Int = 0
|
||||||
override val maxFailureCount: Int = 1
|
override val maxFailureCount: Int = 10
|
||||||
|
|
||||||
val shouldRunAgain = AtomicBoolean(false)
|
val shouldRunAgain = AtomicBoolean(false)
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ data class ConfigurationSyncJob(val destination: Destination): Job {
|
|||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e(TAG, "Error performing batch request", e)
|
Log.e(TAG, "Error performing batch request", e)
|
||||||
return delegate.handleJobFailedPermanently(this, dispatcherName, e)
|
return delegate.handleJobFailed(this, dispatcherName, e)
|
||||||
}
|
}
|
||||||
delegate.handleJobSucceeded(this, dispatcherName)
|
delegate.handleJobSucceeded(this, dispatcherName)
|
||||||
if (shouldRunAgain.get() && storage.getConfigSyncJob(destination) == null) {
|
if (shouldRunAgain.get() && storage.getConfigSyncJob(destination) == null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user