minor improvements

This commit is contained in:
MasterGordon 2025-10-26 00:52:56 +02:00
parent 77329562ec
commit efaf30a863
2 changed files with 4 additions and 4 deletions

View File

@ -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,
}, },
); );

View File

@ -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",