From 4d5a49f11e1064072e1b8cb4241cd25d87f6a3ed Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Thu, 26 Oct 2023 19:09:29 +0100 Subject: [PATCH] fix fmt --- Probe/Utils/Monitors/MonitorTypes/ApiMonitor.ts | 6 ++---- Probe/Utils/Monitors/MonitorTypes/PingMonitor.ts | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Probe/Utils/Monitors/MonitorTypes/ApiMonitor.ts b/Probe/Utils/Monitors/MonitorTypes/ApiMonitor.ts index b10a3043a6a..bb85f74ada7 100644 --- a/Probe/Utils/Monitors/MonitorTypes/ApiMonitor.ts +++ b/Probe/Utils/Monitors/MonitorTypes/ApiMonitor.ts @@ -189,8 +189,6 @@ export default class ApiMonitor { return await this.ping(url, options); } - - if (!options.isOnlineCheckRequest) { if (!(await ApiMonitor.isProbeOnline())) { logger.error( @@ -213,8 +211,8 @@ export default class ApiMonitor { failureCause: (err as any).toString(), }; - // check if timeout exceeded and if yes, return null - if ( + // check if timeout exceeded and if yes, return null + if ( (err as any).toString().includes('timeout') && (err as any).toString().includes('exceeded') ) { diff --git a/Probe/Utils/Monitors/MonitorTypes/PingMonitor.ts b/Probe/Utils/Monitors/MonitorTypes/PingMonitor.ts index c23db33da55..5d78e905990 100644 --- a/Probe/Utils/Monitors/MonitorTypes/PingMonitor.ts +++ b/Probe/Utils/Monitors/MonitorTypes/PingMonitor.ts @@ -147,7 +147,7 @@ export default class PingMonitor { logger.info( `Ping Monitor - Timeout exceeded ${pingOptions.monitorId?.toString()} ${host.toString()} - ERROR: ${err}` ); - + return { isOnline: false, failureCause: 'Timeout exceeded',