Track unable to become ready within timeout

Summary: This is currently done by querying the 'console-log' event. Instead, make it type safe and official.

Reviewed By: antonk52

Differential Revision: D50927954

fbshipit-source-id: ff767acdc51b942c6deb92ffbfd93288b3367062
This commit is contained in:
Lorenzo Blasa
2023-11-02 10:42:15 -07:00
committed by Facebook GitHub Bot
parent d5a0c206f2
commit afae1bd141
2 changed files with 2 additions and 0 deletions

View File

@@ -110,6 +110,7 @@ export async function startServer(
}> {
setTimeout(() => {
if (!isReady && isProduction()) {
tracker.track('server-ready-timeout', {timeout: timeoutSeconds});
console.error(
`[flipper-server] Unable to become ready within ${timeoutSeconds} seconds, exit`,
);

View File

@@ -49,6 +49,7 @@ type TrackerEvents = {
'server-socket-already-in-use': {};
'server-open-ui': {browser: boolean; hasToken: boolean};
'server-ws-server-error': {port: number; error: string};
'server-ready-timeout': {timeout: number};
'browser-connection-created': {
successful: boolean;
timeMS: number;