problem: disconnects from WebSocket if multiple upstreams are set

This commit is contained in:
Igor Artamonov
2021-09-23 22:27:33 -04:00
parent bafffe09d8
commit 84ca9d7dcf
2 changed files with 3 additions and 4 deletions

View File

@@ -141,9 +141,8 @@ class EthereumWsFactory(
}
fun connect() {
if (keepConnection) {
connectInternal()
}
keepConnection = true
connectInternal()
}
private fun tryReconnectLater() {
@@ -383,6 +382,7 @@ class EthereumWsFactory(
}
override fun close() {
log.info("Closing connection to WebSocket $uri")
keepConnection = false
connection?.dispose()
connection = null

View File

@@ -45,7 +45,6 @@ class EthereumWsHead(
}
override fun stop() {
ws.close()
subscription?.dispose()
subscription = null
}