From 4eaff4e6b972be78c5a44450c5f72777214ed674 Mon Sep 17 00:00:00 2001 From: Anton Vakhrushev Date: Sun, 29 Mar 2020 17:43:25 +0300 Subject: [PATCH] Fix message and wait time --- src/Scheduler.ts | 4 ++-- src/utils.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Scheduler.ts b/src/Scheduler.ts index 7aff45a..d9740cd 100644 --- a/src/Scheduler.ts +++ b/src/Scheduler.ts @@ -3,7 +3,7 @@ import UpgradeBuildingTask from './Task/UpgradeBuildingTask'; import GoToBuildingAction from './Action/GoToBuildingAction'; import UpgradeBuildingAction from './Action/UpgradeBuildingAction'; import { TryLaterError } from './Errors'; -import { TaskQueue, State, ImmutableState } from './Storage/TaskQueue'; +import { TaskQueue, ImmutableState } from './Storage/TaskQueue'; import ActionQueue from './Storage/ActionQueue'; import { Args, Command } from './Common'; import TaskQueueRenderer from './TaskQueueRenderer'; @@ -99,7 +99,7 @@ export default class Scheduler { try { await action.run(args); } catch (e) { - console.warn('ACTION ERROR', e); + console.warn('ACTION ABORTED', e.message); if (e instanceof TryLaterError) { console.warn('TRY AFTER', e.seconds); this.actionQueue.clear(); diff --git a/src/utils.ts b/src/utils.ts index 2b3ebb5..7036d17 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -9,7 +9,7 @@ export async function sleepShort() { } export async function sleepLong() { - let ms = 30000 + Math.random() * 30000; + let ms = 30_000 + Math.random() * 120_000; console.log('SLEEP LONG', Math.round(ms)); return await sleep(ms); }