From 0b389921157f5198667d6a7ffdea1db8e9c672cd Mon Sep 17 00:00:00 2001 From: Wojciech Meler Date: Thu, 2 Dec 2021 17:05:10 +0100 Subject: [PATCH] Update TimeTag with previous value to force 60 second back-off in case of error getting max time #817 --- src/common/utils/time-monitor/time-monitor.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/utils/time-monitor/time-monitor.ts b/src/common/utils/time-monitor/time-monitor.ts index 24dfdb372..f4a86d44c 100644 --- a/src/common/utils/time-monitor/time-monitor.ts +++ b/src/common/utils/time-monitor/time-monitor.ts @@ -49,7 +49,7 @@ export class TimeMonitor { return this; } - private doCheck = ({ name }: TimeTag): Promise => { + private doCheck = ({name,time}: TimeTag): Promise => { const { logger, checks } = this; const check = checks.get(name); if (!check) return Promise.resolve(null); @@ -58,6 +58,7 @@ export class TimeMonitor { this.timekeeper = this.timekeeper.updateTime(name, updatedTime); }).catch(e => { logger.error(`Error getting time for '${name}': ${e.message}`); + this.timekeeper = this.timekeeper.updateTime(name, time); } ); }