Fix message and wait time
This commit is contained in:
parent
3905097151
commit
4eaff4e6b9
@ -3,7 +3,7 @@ import UpgradeBuildingTask from './Task/UpgradeBuildingTask';
|
|||||||
import GoToBuildingAction from './Action/GoToBuildingAction';
|
import GoToBuildingAction from './Action/GoToBuildingAction';
|
||||||
import UpgradeBuildingAction from './Action/UpgradeBuildingAction';
|
import UpgradeBuildingAction from './Action/UpgradeBuildingAction';
|
||||||
import { TryLaterError } from './Errors';
|
import { TryLaterError } from './Errors';
|
||||||
import { TaskQueue, State, ImmutableState } from './Storage/TaskQueue';
|
import { TaskQueue, ImmutableState } from './Storage/TaskQueue';
|
||||||
import ActionQueue from './Storage/ActionQueue';
|
import ActionQueue from './Storage/ActionQueue';
|
||||||
import { Args, Command } from './Common';
|
import { Args, Command } from './Common';
|
||||||
import TaskQueueRenderer from './TaskQueueRenderer';
|
import TaskQueueRenderer from './TaskQueueRenderer';
|
||||||
@ -99,7 +99,7 @@ export default class Scheduler {
|
|||||||
try {
|
try {
|
||||||
await action.run(args);
|
await action.run(args);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn('ACTION ERROR', e);
|
console.warn('ACTION ABORTED', e.message);
|
||||||
if (e instanceof TryLaterError) {
|
if (e instanceof TryLaterError) {
|
||||||
console.warn('TRY AFTER', e.seconds);
|
console.warn('TRY AFTER', e.seconds);
|
||||||
this.actionQueue.clear();
|
this.actionQueue.clear();
|
||||||
|
@ -9,7 +9,7 @@ export async function sleepShort() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function sleepLong() {
|
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));
|
console.log('SLEEP LONG', Math.round(ms));
|
||||||
return await sleep(ms);
|
return await sleep(ms);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user