fix(core): update

This commit is contained in:
Philipp Kunz 2023-08-13 09:37:23 +02:00
parent d04ed21607
commit 6499dd45cf
3 changed files with 12 additions and 3 deletions

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@push.rocks/taskbuffer', name: '@push.rocks/taskbuffer',
version: '3.1.2', version: '3.1.3',
description: 'flexible task management. TypeScript ready!' description: 'flexible task management. TypeScript ready!'
} }

View File

@ -30,4 +30,7 @@ export abstract class AbstractDistributedCoordinator {
public abstract updateDistributedTaskRequest( public abstract updateDistributedTaskRequest(
infoBasis: IDistributedTaskRequest infoBasis: IDistributedTaskRequest
): Promise<void>; ): Promise<void>;
public abstract start(): Promise<void>;
public abstract stop(): Promise<void>;
} }

View File

@ -121,11 +121,17 @@ export class TaskManager {
return task && task.cronJob ? task.cronJob.cronExpression : null; return task && task.cronJob ? task.cronJob.cronExpression : null;
} }
public start() { public async start() {
if (this.options.distributedCoordinator) {
await this.options.distributedCoordinator.start();
}
this.cronJobManager.start(); this.cronJobManager.start();
} }
public stop() { public async stop() {
this.cronJobManager.stop(); this.cronJobManager.stop();
if (this.options.distributedCoordinator) {
await this.options.distributedCoordinator.stop();
}
} }
} }