🐛 Fix that active executions could not be canceled in main mode

This commit is contained in:
Jan Oberhauser 2021-10-07 13:53:45 -05:00
parent 3fe5a2ddff
commit 1d90cd3b09

View file

@ -74,8 +74,11 @@ export class WorkflowExecute {
* @returns {(Promise<string>)} * @returns {(Promise<string>)}
* @memberof WorkflowExecute * @memberof WorkflowExecute
*/ */
// @ts-ignore // IMPORTANT: Do not add "async" to this function, it will then convert the
async run(workflow: Workflow, startNode?: INode, destinationNode?: string): PCancelable<IRun> { // PCancelable to a regular Promise and does so not allow canceling
// active executions anymore
// eslint-disable-next-line @typescript-eslint/promise-function-async
run(workflow: Workflow, startNode?: INode, destinationNode?: string): PCancelable<IRun> {
// Get the nodes to start workflow execution from // Get the nodes to start workflow execution from
startNode = startNode || workflow.getStartNode(destinationNode); startNode = startNode || workflow.getStartNode(destinationNode);
@ -134,8 +137,11 @@ export class WorkflowExecute {
* @returns {(Promise<string>)} * @returns {(Promise<string>)}
* @memberof WorkflowExecute * @memberof WorkflowExecute
*/ */
// @ts-ignore // IMPORTANT: Do not add "async" to this function, it will then convert the
async runPartialWorkflow( // PCancelable to a regular Promise and does so not allow canceling
// active executions anymore
// eslint-disable-next-line @typescript-eslint/promise-function-async
runPartialWorkflow(
workflow: Workflow, workflow: Workflow,
runData: IRunData, runData: IRunData,
startNodes: string[], startNodes: string[],
@ -576,8 +582,11 @@ export class WorkflowExecute {
* @returns {Promise<string>} * @returns {Promise<string>}
* @memberof WorkflowExecute * @memberof WorkflowExecute
*/ */
// @ts-ignore // IMPORTANT: Do not add "async" to this function, it will then convert the
async processRunExecutionData(workflow: Workflow): PCancelable<IRun> { // PCancelable to a regular Promise and does so not allow canceling
// active executions anymore
// eslint-disable-next-line @typescript-eslint/promise-function-async
processRunExecutionData(workflow: Workflow): PCancelable<IRun> {
Logger.verbose('Workflow execution started', { workflowId: workflow.id }); Logger.verbose('Workflow execution started', { workflowId: workflow.id });
const startedAt = new Date(); const startedAt = new Date();
@ -1063,8 +1072,7 @@ export class WorkflowExecute {
startedAt: Date, startedAt: Date,
workflow: Workflow, workflow: Workflow,
executionError?: ExecutionError, executionError?: ExecutionError,
// @ts-ignore ): Promise<IRun> {
): PCancelable<IRun> {
const fullRunData = this.getFullRunData(startedAt); const fullRunData = this.getFullRunData(startedAt);
if (executionError !== undefined) { if (executionError !== undefined) {