From cd5b0dc4d871fe81769c82db30630bdf56a4b7f6 Mon Sep 17 00:00:00 2001 From: Junyi Date: Thu, 12 Dec 2024 13:41:08 +0800 Subject: [PATCH] fix(plugin-workflow): fix transaction when delete execution after processed (#5870) --- packages/plugins/@nocobase/plugin-workflow/src/server/Plugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugins/@nocobase/plugin-workflow/src/server/Plugin.ts b/packages/plugins/@nocobase/plugin-workflow/src/server/Plugin.ts index fc2e874f0b..ddf5b3d69e 100644 --- a/packages/plugins/@nocobase/plugin-workflow/src/server/Plugin.ts +++ b/packages/plugins/@nocobase/plugin-workflow/src/server/Plugin.ts @@ -599,7 +599,7 @@ export default class PluginWorkflowServer extends Plugin { await (job ? processor.resume(job) : processor.start()); logger.info(`execution (${execution.id}) finished with status: ${execution.status}`, { execution }); if (execution.status && execution.workflow.options?.deleteExecutionOnStatus?.includes(execution.status)) { - await execution.destroy(); + await execution.destroy({ transaction: processor.mainTransaction }); } } catch (err) { logger.error(`execution (${execution.id}) error: ${err.message}`, err);