Skip to content

Commit

Permalink
Update TimeTag with previous value to force 60 second back-off in cas…
Browse files Browse the repository at this point in the history
…e of error getting max time allegro#817
Wojciech Meler committed Dec 2, 2021
1 parent 5b1f30b commit 0b38992
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/common/utils/time-monitor/time-monitor.ts
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ export class TimeMonitor {
return this;
}

private doCheck = ({ name }: TimeTag): Promise<void> => {
private doCheck = ({name,time}: TimeTag): Promise<void> => {
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);
}
);
}

0 comments on commit 0b38992

Please sign in to comment.