Moving byte count to count all messages from relays, including errors.

This commit is contained in:
Vitor Pamplona
2023-03-28 09:01:26 -04:00
parent ceab807f98
commit 9ae860a66a
@@ -83,6 +83,8 @@ class Relay(
}
override fun onMessage(webSocket: WebSocket, text: String) {
eventDownloadCounterInBytes += text.bytesUsedInMemory()
try {
val msg = Event.gson.fromJson(text, JsonElement::class.java).asJsonArray
val type = msg[0].asString
@@ -90,7 +92,6 @@ class Relay(
when (type) {
"EVENT" -> {
// Log.w("Relay", "Relay onEVENT $url, $channel")
eventDownloadCounterInBytes += text.bytesUsedInMemory()
val event = Event.fromJson(msg[2], Client.lenient)
if (event.kind == 23195 || event.kind == 23196) {