Add logging to Js5ChannelHandler

Signed-off-by: Graham <gpe@openrs2.org>
bzip2
Graham 4 years ago
parent d67a5e690f
commit fdd0f118f2
  1. 7
      archive/src/main/kotlin/org/openrs2/archive/cache/Js5ChannelHandler.kt

@ -1,5 +1,6 @@
package org.openrs2.archive.cache package org.openrs2.archive.cache
import com.github.michaelbull.logging.InlineLogger
import io.netty.bootstrap.Bootstrap import io.netty.bootstrap.Bootstrap
import io.netty.buffer.ByteBuf import io.netty.buffer.ByteBuf
import io.netty.channel.ChannelHandler import io.netty.channel.ChannelHandler
@ -64,6 +65,8 @@ public class Js5ChannelHandler(
while (inFlightRequests.size < maxInFlightRequests) { while (inFlightRequests.size < maxInFlightRequests) {
val request = pendingRequests.removeFirstOrNull() ?: break val request = pendingRequests.removeFirstOrNull() ?: break
inFlightRequests += request inFlightRequests += request
logger.info { "Requesting archive ${request.archive} group ${request.group}" }
ctx.write(request, ctx.voidPromise()) ctx.write(request, ctx.voidPromise())
flush = true flush = true
@ -199,4 +202,8 @@ public class Js5ChannelHandler(
groups.forEach(CacheImporter.Group::release) groups.forEach(CacheImporter.Group::release)
groups.clear() groups.clear()
} }
private companion object {
private val logger = InlineLogger()
}
} }

Loading…
Cancel
Save