mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-25 05:27:42 +00:00
Depend on libsignal-net's connection backoff instead of duplicating at app-level.
This commit is contained in:
committed by
Michelle Tang
parent
752ed93b6f
commit
1aed82d5b7
@@ -354,9 +354,13 @@ class IncomingMessageObserver(private val context: Application, private val auth
|
||||
while (!terminated) {
|
||||
Log.i(TAG, "Waiting for websocket state change....")
|
||||
if (attempts > 1) {
|
||||
val backoff = BackoffUtil.exponentialBackoff(attempts, TimeUnit.SECONDS.toMillis(30))
|
||||
Log.w(TAG, "Too many failed connection attempts, attempts: $attempts backing off: $backoff")
|
||||
sleepTimer.sleep(backoff)
|
||||
if (RemoteConfig.libSignalWebSocketEnabled) {
|
||||
Log.i(TAG, "Skipping app-level exponential back-off; depending on built-in back-off in LibSignalChatConnection.")
|
||||
} else {
|
||||
val backoff = BackoffUtil.exponentialBackoff(attempts, TimeUnit.SECONDS.toMillis(30))
|
||||
Log.w(TAG, "Too many failed connection attempts, attempts: $attempts backing off: $backoff")
|
||||
sleepTimer.sleep(backoff)
|
||||
}
|
||||
}
|
||||
|
||||
waitForConnectionNecessary()
|
||||
|
||||
Reference in New Issue
Block a user