Moving byte count to count all messages from relays, including errors.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user