diff --git a/core/modules/FxScheduler.ts b/core/modules/FxScheduler.ts index 45a9395b6..4cf910571 100644 --- a/core/modules/FxScheduler.ts +++ b/core/modules/FxScheduler.ts @@ -53,6 +53,7 @@ export default class FxScheduler { private nextTempSchedule: RestartInfo | false = false; private calculatedNextRestartMinuteFloorTs: number | false = false; private nextSkip: number | false = false; + private lastMinute = Math.floor(Date.now() / 60000); constructor() { //Initial check to update status @@ -62,9 +63,12 @@ export default class FxScheduler { //Cron Function setInterval(() => { - this.checkSchedule(); - txCore.webServer.webSocket.pushRefresh('status'); - }, 60 * 1000); + const currentMinute = Math.floor(Date.now() / 60000); + if (currentMinute > this.lastMinute) { + this.checkSchedule(); + txCore.webServer.webSocket.pushRefresh('status'); + } + }, 1000); } @@ -232,6 +236,7 @@ export default class FxScheduler { * Checks the schedule to see if it's time to announce or restart the server */ async checkSchedule(calculateOnly = false) { + this.lastMinute = Math.floor(Date.now() / 60000); //Check settings and temp scheduled restart let nextRestart: RestartInfo; if (this.nextTempSchedule) {