From 407f88758440f3be467f74e477120ef59d64d3aa Mon Sep 17 00:00:00 2001 From: Junyi Date: Fri, 2 Feb 2024 21:11:08 +0800 Subject: [PATCH] fix(plugin-workflow): fix processor options to pass any context (#3483) --- .../@nocobase/plugin-workflow/src/server/Plugin.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/plugins/@nocobase/plugin-workflow/src/server/Plugin.ts b/packages/plugins/@nocobase/plugin-workflow/src/server/Plugin.ts index fd62c35a97..16540e48f5 100644 --- a/packages/plugins/@nocobase/plugin-workflow/src/server/Plugin.ts +++ b/packages/plugins/@nocobase/plugin-workflow/src/server/Plugin.ts @@ -484,16 +484,12 @@ export default class PluginWorkflowServer extends Plugin { })(); } - private async process( - execution: ExecutionModel, - job?: JobModel, - { transaction }: Transactionable = {}, - ): Promise { + private async process(execution: ExecutionModel, job?: JobModel, options: Transactionable = {}): Promise { if (execution.status === EXECUTION_STATUS.QUEUEING) { - await execution.update({ status: EXECUTION_STATUS.STARTED }, { transaction }); + await execution.update({ status: EXECUTION_STATUS.STARTED }, { transaction: options.transaction }); } - const processor = this.createProcessor(execution, { transaction }); + const processor = this.createProcessor(execution, options); this.getLogger(execution.workflowId).info(`execution (${execution.id}) ${job ? 'resuming' : 'starting'}...`);