Bugfix for broadcastToWebhook
Properly close connections on timeout
This commit is contained in:
parent
dddfe6da75
commit
d59e6e11d5
@ -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}
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user