Do not re-schedule recheck indefinitely, run it after mon_change_timeout in any case

rm-left-on-dead
Vitaliy Filippov 2023-01-05 13:48:06 +03:00
parent 41add50e4e
commit 465cbf0b2f
1 changed files with 6 additions and 8 deletions

View File

@ -1378,17 +1378,15 @@ class Mon
// This is required for multiple change events to trigger at most 1 recheck in 1s // This is required for multiple change events to trigger at most 1 recheck in 1s
schedule_recheck() schedule_recheck()
{ {
if (this.recheck_timer) if (!this.recheck_timer)
{ {
clearTimeout(this.recheck_timer);
this.recheck_timer = null;
}
this.recheck_timer = setTimeout(() => this.recheck_timer = setTimeout(() =>
{ {
this.recheck_timer = null; this.recheck_timer = null;
this.recheck_pgs().catch(this.die); this.recheck_pgs().catch(this.die);
}, this.config.mon_change_timeout || 1000); }, this.config.mon_change_timeout || 1000);
} }
}
sum_op_stats(timestamp, prev_stats) sum_op_stats(timestamp, prev_stats)
{ {