From 44e9cb689c6c9ae0a0ef08719ae4cac085f94ae7 Mon Sep 17 00:00:00 2001 From: Adil Ansari Date: Thu, 17 Nov 2022 16:26:26 -0800 Subject: [PATCH] fix: Sticky connections are disabled by default (#170) --- src/tigris.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tigris.ts b/src/tigris.ts index ebbc575..c06fb75 100644 --- a/src/tigris.ts +++ b/src/tigris.ts @@ -54,10 +54,10 @@ export interface TigrisClientConfig { supportBigInt?: boolean; /** - * Tigris makes periodic ping to server in order to keep connection alive in case if user's + * Tigris can make periodic ping to server in order to keep connection alive in case if user's * workload is pub/sub with no messages for long period. */ - disablePing?: boolean; + enablePing?: boolean; /** * Controls the ping interval, if not specified defaults to 300_000ms (i.e. 5 min) @@ -228,8 +228,8 @@ export class Tigris { } }); }; - if (config.disablePing === undefined || !config.disablePing) { - // make a ping to server every 5 minute + if (config.enablePing) { + // make a ping to server at configured interval let pingIntervalMs = config.pingIntervalMs; if (pingIntervalMs === undefined) { // 5min