feat: add automatic task scheduling configuration for Windows and Linux

This commit is contained in:
2025-11-04 20:51:49 +01:00
parent c74b131ac6
commit 014beda152
6 changed files with 659 additions and 11 deletions

View File

@@ -19,6 +19,7 @@ import { QueryDiversityEngine } from './util/QueryDiversityEngine'
import JobState from './util/JobState'
import { StartupValidator } from './util/StartupValidator'
import { MobileRetryTracker } from './util/MobileRetryTracker'
import { SchedulerManager } from './util/SchedulerManager'
import { Login } from './functions/Login'
import { Workers } from './functions/Workers'
@@ -128,6 +129,12 @@ export class MicrosoftRewardsBot {
if (this.config.jobState?.enabled !== false) {
this.accountJobState = new JobState(this.config)
}
// Setup automatic scheduler if enabled
if (this.config.scheduling?.enabled) {
const scheduler = new SchedulerManager(this.config)
await scheduler.setup()
}
}
private shouldSkipAccount(email: string, dayKey: string): boolean {