From eaf5b4c2465a1c56bce5d5a4febb4f1f925a5e40 Mon Sep 17 00:00:00 2001 From: Luke De Feo Date: Tue, 1 Aug 2023 10:32:29 -0700 Subject: [PATCH] Dont kill flipper server when no clients connect and is dev Summary: This is quite annoying and causes may un needed reboots of flipper server while developing Reviewed By: antonk52 Differential Revision: D47949842 fbshipit-source-id: c2f18e16a4933e4209e74f51978cb7d05b80ee11 --- desktop/flipper-server-core/src/server/attachSocketServer.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desktop/flipper-server-core/src/server/attachSocketServer.tsx b/desktop/flipper-server-core/src/server/attachSocketServer.tsx index 8258899ae..4fffdf41c 100644 --- a/desktop/flipper-server-core/src/server/attachSocketServer.tsx +++ b/desktop/flipper-server-core/src/server/attachSocketServer.tsx @@ -17,6 +17,7 @@ import { SystemError, getLogger, CompanionEventWebSocketMessage, + isProduction, } from 'flipper-common'; import {FlipperServerImpl} from '../FlipperServerImpl'; import {RawData, WebSocketServer} from 'ws'; @@ -242,7 +243,7 @@ export function attachSocketServer( * If, after 15 min, there are no more connected clients, we exit the process. */ disconnectTimeout = setTimeout(() => { - if (numberOfConnectedClients === 0) { + if (numberOfConnectedClients === 0 && isProduction()) { console.info('Shutdown as no clients are currently connected'); process.exit(0); }