From c56bdea1e2ccbdbaf8ccf40694a377a426a1e2dd Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Mon, 16 Oct 2023 02:14:10 +0200 Subject: [PATCH] Do not log ping messages (#709) --- .../ApolloSubscriptionProtocolHandler.kt | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/server/src/main/kotlin/suwayomi/tachidesk/graphql/server/subscriptions/ApolloSubscriptionProtocolHandler.kt b/server/src/main/kotlin/suwayomi/tachidesk/graphql/server/subscriptions/ApolloSubscriptionProtocolHandler.kt index 1fedc7af..3d4e5a77 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/graphql/server/subscriptions/ApolloSubscriptionProtocolHandler.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/graphql/server/subscriptions/ApolloSubscriptionProtocolHandler.kt @@ -66,16 +66,19 @@ class ApolloSubscriptionProtocolHandler( fun handleMessage(context: WsMessageContext): Flow { val operationMessage = convertToMessageOrNull(context.message()) ?: return flowOf(basicConnectionErrorMessage) - logger.debug { - "GraphQL subscription client message, sessionId=${context.sessionId} type=${operationMessage.type} operationName=${ - getOperationName(operationMessage.payload) - } ${ - if (serverConfig.gqlDebugLogsEnabled.value) { - "operationMessage=$operationMessage" - } else { - "" - } - }" + + if (operationMessage.type != GQL_PING.type) { + logger.debug { + "GraphQL subscription client message, sessionId=${context.sessionId} type=${operationMessage.type} operationName=${ + getOperationName(operationMessage.payload) + } ${ + if (serverConfig.gqlDebugLogsEnabled.value) { + "operationMessage=$operationMessage" + } else { + "" + } + }" + } } return try {