fix(plugin-workflow): fix processor options to pass any context (#3483)

This commit is contained in:
Junyi 2024-02-02 21:11:08 +08:00 committed by GitHub
parent 74a0254d5c
commit 407f887584
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -484,16 +484,12 @@ export default class PluginWorkflowServer extends Plugin {
})(); })();
} }
private async process( private async process(execution: ExecutionModel, job?: JobModel, options: Transactionable = {}): Promise<Processor> {
execution: ExecutionModel,
job?: JobModel,
{ transaction }: Transactionable = {},
): Promise<Processor> {
if (execution.status === EXECUTION_STATUS.QUEUEING) { 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'}...`); this.getLogger(execution.workflowId).info(`execution (${execution.id}) ${job ? 'resuming' : 'starting'}...`);