Skip to content

Commit

Permalink
TaskManager tasks scheduled without attempting to run
Browse files Browse the repository at this point in the history
  • Loading branch information
kobelb committed Mar 31, 2020
1 parent 7fe06f7 commit 55fa3ec
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions x-pack/plugins/task_manager/server/task_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ export class TaskManager {
this.events$.next(event);
};

private attemptToRun(task: Option<string> = none) {
this.claimRequests$.next(task);
private attemptToRun(task: string) {
this.claimRequests$.next(some(task));
}

private createTaskRunnerForTask = (instance: ConcreteTaskInstance) => {
Expand Down Expand Up @@ -280,9 +280,7 @@ export class TaskManager {
...options,
taskInstance: ensureDeprecatedFieldsAreCorrected(taskInstance, this.logger),
});
const result = await this.store.schedule(modifiedTask);
this.attemptToRun();
return result;
return await this.store.schedule(modifiedTask);
}

/**
Expand All @@ -298,7 +296,7 @@ export class TaskManager {
.then(resolve)
.catch(reject);

this.attemptToRun(some(taskId));
this.attemptToRun(taskId);
});
}

Expand Down

0 comments on commit 55fa3ec

Please sign in to comment.