minor improvements
This commit is contained in:
parent
77329562ec
commit
efaf30a863
6
index.ts
6
index.ts
|
|
@ -79,7 +79,7 @@ async function isProcessRunning(pid: number): Promise<boolean> {
|
||||||
async function isServerResponsive(port: number): Promise<boolean> {
|
async function isServerResponsive(port: number): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`http://localhost:${port}/`, {
|
const response = await fetch(`http://localhost:${port}/`, {
|
||||||
signal: AbortSignal.timeout(2000),
|
signal: AbortSignal.timeout(50),
|
||||||
});
|
});
|
||||||
return response.ok || response.status === 404; // Server is up if it responds at all
|
return response.ok || response.status === 404; // Server is up if it responds at all
|
||||||
} catch {
|
} catch {
|
||||||
|
|
@ -109,8 +109,8 @@ async function startServer(): Promise<number> {
|
||||||
const proc = Bun.spawn(
|
const proc = Bun.spawn(
|
||||||
["dotnet", "csharpier", "server", "--server-port", String(SERVER_PORT)],
|
["dotnet", "csharpier", "server", "--server-port", String(SERVER_PORT)],
|
||||||
{
|
{
|
||||||
stdout: "inherit",
|
stdout: null,
|
||||||
stderr: "inherit",
|
stderr: null,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "csharpierd",
|
"name": "csharpierd",
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"description": "A persistent CSharpier formatting daemon with automatic server management and idle timeout",
|
"description": "A persistent CSharpier formatting daemon with automatic server management and idle timeout",
|
||||||
"module": "index.ts",
|
"module": "index.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue