mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-22 04:55:29 +03:00
sleep one second before websocket reconnect
otherwise it's an endless loop without delay which may stress the devices... Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
e7d596f402
commit
24c27d0029
1 changed files with 3 additions and 0 deletions
|
@ -41,6 +41,7 @@ import org.greenrobot.eventbus.EventBus
|
|||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
import java.io.IOException
|
||||
import java.lang.Thread.sleep
|
||||
import javax.inject.Inject
|
||||
|
||||
@AutoInjector(NextcloudTalkApplication::class)
|
||||
|
@ -127,6 +128,7 @@ class WebSocketInstance internal constructor(
|
|||
isConnected = false
|
||||
messagesQueue = ArrayList()
|
||||
}
|
||||
sleep(ONE_SECOND)
|
||||
restartWebSocket()
|
||||
}
|
||||
|
||||
|
@ -485,5 +487,6 @@ class WebSocketInstance internal constructor(
|
|||
companion object {
|
||||
private const val TAG = "WebSocketInstance"
|
||||
private const val NORMAL_CLOSURE = 1000
|
||||
private const val ONE_SECOND: Long = 1000
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue