mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 11:39:42 +01:00
Merge pull request #4194 from nextcloud/bugfix/noid/delayWebsocketReconnect
sleep one second before websocket reconnect
This commit is contained in:
commit
50c9cfdb54
@ -41,6 +41,7 @@ import org.greenrobot.eventbus.EventBus
|
|||||||
import org.greenrobot.eventbus.Subscribe
|
import org.greenrobot.eventbus.Subscribe
|
||||||
import org.greenrobot.eventbus.ThreadMode
|
import org.greenrobot.eventbus.ThreadMode
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
import java.lang.Thread.sleep
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@AutoInjector(NextcloudTalkApplication::class)
|
@AutoInjector(NextcloudTalkApplication::class)
|
||||||
@ -127,6 +128,7 @@ class WebSocketInstance internal constructor(
|
|||||||
isConnected = false
|
isConnected = false
|
||||||
messagesQueue = ArrayList()
|
messagesQueue = ArrayList()
|
||||||
}
|
}
|
||||||
|
sleep(ONE_SECOND)
|
||||||
restartWebSocket()
|
restartWebSocket()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -485,5 +487,6 @@ class WebSocketInstance internal constructor(
|
|||||||
companion object {
|
companion object {
|
||||||
private const val TAG = "WebSocketInstance"
|
private const val TAG = "WebSocketInstance"
|
||||||
private const val NORMAL_CLOSURE = 1000
|
private const val NORMAL_CLOSURE = 1000
|
||||||
|
private const val ONE_SECOND: Long = 1000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user