From 7e2508f0454eae35138d2d0109cbecabd5f5952a Mon Sep 17 00:00:00 2001 From: Andrey Goncharov Date: Tue, 21 Nov 2023 04:13:12 -0800 Subject: [PATCH] Fix server dummy timeout value Summary: It has to fit in 32 bit int Reviewed By: lblasa Differential Revision: D51478071 fbshipit-source-id: c4512e946c3e47bc235920b133d9f6c739c5ac76 --- desktop/flipper-server/src/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/desktop/flipper-server/src/index.tsx b/desktop/flipper-server/src/index.tsx index bb438869b..c7c81ec42 100644 --- a/desktop/flipper-server/src/index.tsx +++ b/desktop/flipper-server/src/index.tsx @@ -341,8 +341,10 @@ process.on('unhandledRejection', (reason, promise) => { ); }); +// It has to fit in 32 bit int +const MAX_TIMEOUT = 2147483647; // Node.js process never waits for all promises to settle and exits as soon as there is not pending timers or open sockets or tasks in teh macroqueue -const runtimeTimeout = setTimeout(() => {}, Number.MAX_SAFE_INTEGER); +const runtimeTimeout = setTimeout(() => {}, MAX_TIMEOUT); // eslint-disable-next-line promise/catch-or-return start() .catch((e) => {