From 465cbf0b2fa36614524a494189494bd7a192fa56 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Thu, 5 Jan 2023 13:48:06 +0300 Subject: [PATCH] Do not re-schedule recheck indefinitely, run it after mon_change_timeout in any case --- mon/mon.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/mon/mon.js b/mon/mon.js index 87a090ca..99472f6b 100644 --- a/mon/mon.js +++ b/mon/mon.js @@ -1378,16 +1378,14 @@ class Mon // This is required for multiple change events to trigger at most 1 recheck in 1s 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 = null; + this.recheck_pgs().catch(this.die); + }, this.config.mon_change_timeout || 1000); } - this.recheck_timer = setTimeout(() => - { - this.recheck_timer = null; - this.recheck_pgs().catch(this.die); - }, this.config.mon_change_timeout || 1000); } sum_op_stats(timestamp, prev_stats)