From 93b970dc07f23dcfb85ac9b2f33635e48cef1f72 Mon Sep 17 00:00:00 2001 From: Iain Sproat <68657+iainsproat@users.noreply.github.com> Date: Wed, 21 Aug 2024 13:54:00 +0100 Subject: [PATCH] fix(graphql websocket): keep alive websocket connections if idle (#2720) - if no data is being sent on a websocket connection then it was closed by nginx after 60s - it is assumed to be better to keep alive the connection than have the overhead of closing and re-establishing the connection every 60s --- packages/server/app.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/server/app.ts b/packages/server/app.ts index 397f96599..41dc78a97 100644 --- a/packages/server/app.ts +++ b/packages/server/app.ts @@ -230,7 +230,8 @@ function buildApolloSubscriptionServer( } return baseParams - } + }, + keepAlive: 30000 //milliseconds. Loadbalancers may close the connection after inactivity. e.g. nginx default is 60000ms. }, { server,