From c341c7d7945fc8dbc932b19c18018099535e5113 Mon Sep 17 00:00:00 2001 From: Anton Vakhrushev Date: Thu, 16 Apr 2020 18:00:34 +0300 Subject: [PATCH] Fix scheduled tasks --- src/Scheduler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Scheduler.ts b/src/Scheduler.ts index c1e3fa9..6121c94 100644 --- a/src/Scheduler.ts +++ b/src/Scheduler.ts @@ -39,7 +39,7 @@ export class Scheduler { this.scheduleUniqTask(3600, SendOnAdventureTask.name); this.scheduleUniqTask(1200, BalanceHeroResourcesTask.name); - this.scheduleUniqTask(300, GrabVillageState.name); + this.scheduleUniqTask(180, GrabVillageState.name); while (true) { await this.doTaskProcessingStep(); @@ -54,7 +54,7 @@ export class Scheduler { private scheduleUniqTask(seconds: number, name: string, args: Args = {}) { const taskScheduler = () => { if (!this.taskQueue.hasNamed(name)) { - this.taskQueue.push(name, args, timestamp() + 5 * 60); + this.taskQueue.push(name, args, timestamp() + Math.min(seconds, 5 * 60)); } }; taskScheduler();