Notifies relay failures after marking them as closed.

This commit is contained in:
Vitor Pamplona
2024-08-02 12:36:54 -04:00
parent b02fa43628
commit fd06193e93
@@ -233,6 +233,10 @@ class Relay(
// checks if this is an actual failure. Closing the socket generates an onFailure as well. // checks if this is an actual failure. Closing the socket generates an onFailure as well.
if (!(socket == null && (t.message == "Socket is closed" || t.message == "Socket closed"))) { if (!(socket == null && (t.message == "Socket is closed" || t.message == "Socket closed"))) {
RelayStats.newError(url, response?.message ?: t.message) RelayStats.newError(url, response?.message ?: t.message)
}
// Failures disconnect the relay.
markConnectionAsClosed()
Log.w("Relay", "Relay onFailure $url, ${response?.message} $response ${t.message} $socket") Log.w("Relay", "Relay onFailure $url, ${response?.message} $response ${t.message} $socket")
t.printStackTrace() t.printStackTrace()
@@ -244,10 +248,6 @@ class Relay(
) )
} }
} }
// Failures disconnect the relay.
markConnectionAsClosed()
}
} }
fun markConnectionAsReady( fun markConnectionAsReady(