diff --git a/src/config.ts b/src/config.ts index adc5de3..be83277 100644 --- a/src/config.ts +++ b/src/config.ts @@ -8,7 +8,7 @@ export const config = { // port that server listens on port: parseInt(process.env.DS_PORT || '3000'), // whether to enable 'ws:' - webSocketServerEnabled: { on: true, off: false }[process.env.DS_WEBSOCKET_SERVER] ?? true, + webSocketServerEnabled: { on: true, off: false }[process.env.DWN_WEBSOCKET_SERVER] ?? true, // where to store persistent data messageStore: process.env.DWN_STORAGE_MESSAGES || process.env.DWN_STORAGE || 'level://data', dataStore: process.env.DWN_STORAGE_DATA || process.env.DWN_STORAGE || 'level://data', diff --git a/src/ws-api.ts b/src/ws-api.ts index a4cafa1..25bcc8b 100644 --- a/src/ws-api.ts +++ b/src/ws-api.ts @@ -37,7 +37,7 @@ export class WsApi { */ #setupWebSocket(): void { this.#wsServer.on('connection', this.#connections.connect.bind(this)); - this.#wsServer.on('close', this.#connections.close); + this.#wsServer.on('close', this.#connections.close.bind(this)); } start(callback?: () => void): WebSocketServer { diff --git a/tests/utils.ts b/tests/utils.ts index 9bd625a..7b1b318 100644 --- a/tests/utils.ts +++ b/tests/utils.ts @@ -222,7 +222,7 @@ export async function sendWsMessage( }); } -const MAX_RESPONSE_TIMEOUT = 3_000; +const MAX_RESPONSE_TIMEOUT = 1_500; export async function subscriptionRequest( url: string,