Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions core/modules/FxScheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}


Expand Down Expand Up @@ -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) {
Expand Down