Remove usage of server enabled

Summary: Used last year to GK server usage. This is obsolete so is safe to remove.

Reviewed By: ivanmisuno

Differential Revision: D49414625

fbshipit-source-id: 9eeff932c59c90dff829e4c6c83bad43a0fd74e3
This commit is contained in:
Lorenzo Blasa
2023-09-20 04:10:39 -07:00
committed by Facebook GitHub Bot
parent f897203a32
commit 0540d240c0
3 changed files with 20 additions and 113 deletions

View File

@@ -123,7 +123,6 @@ async function getFlipperServer(
const keytar: KeytarModule | undefined = await getKeytarModule(staticPath);
const gatekeepers = getGatekeepers(environmentInfo.os.unixname);
const serverUsageEnabled = gatekeepers['flipper_desktop_use_server'];
const settings = await loadSettings();
const port = 52342;
/**
@@ -166,66 +165,29 @@ async function getFlipperServer(
await shutdown(TCPconnectionURL);
}
const [homePath, tempPath, desktopPath] = await Promise.all([
electronIpcClient.send('getPath', 'home'),
electronIpcClient.send('getPath', 'temp'),
electronIpcClient.send('getPath', 'desktop'),
]);
console.info('flipper-server: not running/listening, start');
const getEmbeddedServer = async () => {
const server = new FlipperServerImpl(
{
sessionId,
environmentInfo,
env: parseEnvironmentVariables(env),
gatekeepers: gatekeepers,
paths: {
appPath,
homePath,
execPath,
staticPath,
tempPath,
desktopPath,
},
launcherSettings: await loadLauncherSettings(),
processConfig: loadProcessConfig(env),
settings,
validWebSocketOrigins:
constants.VALID_WEB_SOCKET_REQUEST_ORIGIN_PREFIXES,
},
logger,
keytar,
);
const {readyForIncomingConnections} = await startServer({
staticPath,
entry: 'index.web.dev.html',
port,
});
return server;
};
const server = await startFlipperServer(
appPath,
staticPath,
'',
false,
keytar,
'embedded',
environmentInfo,
);
if (serverUsageEnabled && (!settings.server || settings.server.enabled)) {
console.info('flipper-server: not running/listening, start');
const companionEnv = await initCompanionEnv(server);
await server.connect();
await readyForIncomingConnections(server, companionEnv);
const {readyForIncomingConnections} = await startServer({
staticPath,
entry: 'index.web.dev.html',
port,
});
const server = await startFlipperServer(
appPath,
staticPath,
'',
false,
keytar,
'embedded',
environmentInfo,
);
const companionEnv = await initCompanionEnv(server);
await server.connect();
await readyForIncomingConnections(server, companionEnv);
return getExternalServer(TCPconnectionURL);
}
return getEmbeddedServer();
return getExternalServer(TCPconnectionURL);
}
async function start() {