From bf58838b891a9bec92f611e50ab6a14f04de68b6 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Wed, 22 Nov 2023 16:03:03 +0800 Subject: [PATCH] +10 seconds for Abort signal (#4053) * Debug only * Remove debug --- server/model/monitor.js | 2 +- server/util-server.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index 8958e3d80..ec40115c1 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -483,7 +483,7 @@ class Monitor extends BeanModel { validateStatus: (status) => { return checkStatusCode(status, this.getAcceptedStatuscodes()); }, - signal: axiosAbortSignal(this.timeout * 1000), + signal: axiosAbortSignal((this.timeout + 10) * 1000), }; if (bodyValue) { diff --git a/server/util-server.js b/server/util-server.js index 329810be0..b9832af31 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -1141,7 +1141,6 @@ module.exports.axiosAbortSignal = (timeoutMs) => { // v16-: AbortSignal.timeout is not supported try { const abortController = new AbortController(); - setTimeout(() => abortController.abort(), timeoutMs); return abortController.signal;