From 361de38d187ae483e891903a24d55890170be7b4 Mon Sep 17 00:00:00 2001 From: sockmaster27 <61235930+sockmaster27@users.noreply.github.com> Date: Wed, 21 Aug 2024 10:48:00 +0200 Subject: [PATCH] refactor: don't show error when message isn't sent --- server/src/engine/socket.ts | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/server/src/engine/socket.ts b/server/src/engine/socket.ts index 658aa85..a0d68cf 100644 --- a/server/src/engine/socket.ts +++ b/server/src/engine/socket.ts @@ -148,22 +148,7 @@ export async function closeSocket() { } } -export function sendMessage(job: jobs.EnqueuedJob, expectResponse = true, retries = 0) { - if (isClosed()) { - if (retries > 2) { - const errorMessage = USER_MESSAGE.REQUEST_TIMEOUT(retries) - sendNotification(jobs.Request.internalError, { - message: errorMessage, - actions: [], - }) - return - } - setTimeout(() => { - sendMessage(job, expectResponse, retries + 1) - }, 1000) - return - } - +export function sendMessage(job: jobs.EnqueuedJob, expectResponse = true) { if (expectResponse) { // register a timer to handle timeouts sentMessagesMap[job.id] = setTimeout(() => {