diff --git a/@types/Other.ts b/@types/Other.ts index a8fb316..28d38a6 100644 --- a/@types/Other.ts +++ b/@types/Other.ts @@ -52,7 +52,7 @@ export type IPCMessage = { [key: string]: string | number | object | boolean | undefined } -export type WebhookIPC = { payload: Payload, options: WebhookBroadcastOptions } +export type WebhookIPC = { payload: Payload, options?: WebhookBroadcastOptions } export type WebhookBroadcastOptions = { debounce?: { id: string | number, duration: number} diff --git a/src/controller/Controller.ts b/src/controller/Controller.ts index f3f07cf..d5323ae 100644 --- a/src/controller/Controller.ts +++ b/src/controller/Controller.ts @@ -275,7 +275,7 @@ class Controller extends EventEmitter this.#logger.debug(`Message from ${shard.id}: ${inspect(msg)}`); } - async broadcastToWebhook ({ payload, options }: WebhookIPC) + async broadcastToWebhook ({ payload, options = {} }: WebhookIPC) { if (this.#webhook) { diff --git a/src/server/Server.ts b/src/server/Server.ts index b7575ec..ac4c99e 100644 --- a/src/server/Server.ts +++ b/src/server/Server.ts @@ -567,8 +567,9 @@ class Server extends EventEmitter setTimeout(() => { this.#logger.warn('Server close timed out, cleaning up and exiting'); + this.#server?.closeAllConnections(); cleanUp(); - }, 90_000); + }, 10_000); } }