diff --git a/.changeset/weak-cars-relate.md b/.changeset/weak-cars-relate.md new file mode 100644 index 000000000..5555d68a4 --- /dev/null +++ b/.changeset/weak-cars-relate.md @@ -0,0 +1,6 @@ +--- +'@spotlightjs/sidecar': patch +'@spotlightjs/spotlight': patch +--- + +Fix hanging when another Spotlight server is running diff --git a/packages/sidecar/src/main.ts b/packages/sidecar/src/main.ts index 608d59aa0..caaf43f34 100644 --- a/packages/sidecar/src/main.ts +++ b/packages/sidecar/src/main.ts @@ -366,7 +366,8 @@ function isSidecarRunning(port: string | number | undefined) { port: port, path: '/health', method: 'GET', - timeout: 5000, + timeout: 2000, + headers: { Connection: 'close' }, }; const healthReq = get(options, res => { @@ -380,6 +381,7 @@ function isSidecarRunning(port: string | number | undefined) { healthReq.on('error', () => { resolve(false); }); + healthReq.end(); }); }