From 2c892c08e8a759c4f0d297b698686877581001ab Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 2 Jan 2025 11:22:10 -0600 Subject: [PATCH] handle isConnecting and reconnect properly --- .../account-postgres-sink-service/src/services/substream.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/account-postgres-sink-service/src/services/substream.ts b/packages/account-postgres-sink-service/src/services/substream.ts index 5e0fc3cd0..53a58bc77 100644 --- a/packages/account-postgres-sink-service/src/services/substream.ts +++ b/packages/account-postgres-sink-service/src/services/substream.ts @@ -225,10 +225,8 @@ export const setupSubstream = async ( } catch (err) { cursorManager.stopStalenessCheck(); console.log("Substream connection error:", err); - if (!isConnecting) { - isConnecting = true; - handleReconnect(attemptCount + 1); - } + isConnecting = false; + handleReconnect(attemptCount + 1); } };