From b6b04d9929b864a7b45a3d5cf6a4f7f3d5107b06 Mon Sep 17 00:00:00 2001 From: Thaddeus Date: Fri, 11 Feb 2022 08:36:48 +0100 Subject: [PATCH] chore: logging tweaks --- src/minion.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/minion.ts b/src/minion.ts index 5bd6e96..722e14b 100644 --- a/src/minion.ts +++ b/src/minion.ts @@ -242,12 +242,19 @@ class Minion { const message = `Too many requests, slow down. Current limit: ${this.MAX_MESSAGES_PER_SECOND} messages per second.` logger.log('info', message, meta) + logger.log('info', message, { + clientIP: ws.getRemoteAddressAsText(), + ...meta + }) + const errorMessage: ErrorResponse = { type: 'error', message, timestamp: new Date().toISOString() } + await wait(3000) + await this._send(ws, () => JSON.stringify(errorMessage)) return