Fallback port in use
Summary: If no version information is obtained, check if port is in use. This is for the cases in which an older server which may not have implemented this endpoint fails to return version information. In this case, send the shutdown command. Reviewed By: antonk52 Differential Revision: D49830759 fbshipit-source-id: 6c9763d01f335ecc8a28df3b90d319f98016c2da
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3c73074e29
commit
9c80324f5c
@@ -20,6 +20,7 @@ import open from 'open';
|
||||
import os from 'os';
|
||||
import {initCompanionEnv} from 'flipper-server-companion';
|
||||
import {
|
||||
checkPortInUse,
|
||||
checkServerRunning,
|
||||
compareServerVersion,
|
||||
getEnvironmentInfo,
|
||||
@@ -167,6 +168,11 @@ async function start() {
|
||||
} else {
|
||||
launchAndFinish = true;
|
||||
}
|
||||
} else {
|
||||
if (await checkPortInUse(argv.port)) {
|
||||
console.info('[flipper-server] Checking if port is in use');
|
||||
await shutdownRunningInstance(argv.port);
|
||||
}
|
||||
}
|
||||
|
||||
const t3 = performance.now();
|
||||
|
||||
Reference in New Issue
Block a user