mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-20 18:40:57 +08:00
fix: refresh interval getting incremented by 10 on status page despite a minimum of 5 (#5961)
Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
@@ -720,7 +720,7 @@ export default {
|
||||
// Configure auto-refresh loop
|
||||
feedInterval = setInterval(() => {
|
||||
this.updateHeartbeatList();
|
||||
}, (this.config.autoRefreshInterval + 10) * 1000);
|
||||
}, Math.max(5, this.config.autoRefreshInterval) * 1000);
|
||||
|
||||
this.updateUpdateTimer();
|
||||
}).catch( function (error) {
|
||||
@@ -806,7 +806,15 @@ export default {
|
||||
clearInterval(this.updateCountdown);
|
||||
|
||||
this.updateCountdown = setInterval(() => {
|
||||
const countdown = dayjs.duration(this.lastUpdateTime.add(this.config.autoRefreshInterval, "seconds").add(10, "seconds").diff(dayjs()));
|
||||
// rounding here as otherwise we sometimes skip numbers in cases of time drift
|
||||
const countdown = dayjs.duration(
|
||||
Math.round(
|
||||
this.lastUpdateTime
|
||||
.add(Math.max(5, this.config.autoRefreshInterval), "seconds")
|
||||
.diff(dayjs())
|
||||
/ 1000
|
||||
), "seconds");
|
||||
|
||||
if (countdown.as("seconds") < 0) {
|
||||
clearInterval(this.updateCountdown);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user