mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-17 05:29:44 +02:00
fix(core): Reload static data for queued executions (#39668)
Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
This commit is contained in:
parent
0280644e77
commit
439e8ba2e7
|
|
@ -746,6 +746,35 @@ describe('processError', () => {
|
|||
});
|
||||
|
||||
describe('run', () => {
|
||||
it('reloads static data for a new queued execution', async () => {
|
||||
globalConfig.executions.mode = 'queue';
|
||||
try {
|
||||
vi.spyOn(runner, 'establishContextForPersistence').mockResolvedValue(undefined);
|
||||
vi.spyOn(runner, 'prepareNewExecution').mockResolvedValue(mock<Workflow>());
|
||||
vi.spyOn(Container.get(CredentialsPermissionChecker), 'check').mockResolvedValueOnce();
|
||||
vi.spyOn(Container.get(ActiveExecutions), 'add').mockResolvedValue('1');
|
||||
const enqueueExecution = vi.spyOn(runner, 'enqueueExecution').mockResolvedValue();
|
||||
|
||||
const data = mock<IWorkflowExecutionDataProcess>({
|
||||
executionMode: 'trigger',
|
||||
workflowData: { id: 'workflow-id', nodes: [], staticData: {} },
|
||||
});
|
||||
|
||||
await runner.run(data, true);
|
||||
|
||||
expect(enqueueExecution).toHaveBeenCalledWith(
|
||||
'1',
|
||||
'workflow-id',
|
||||
data,
|
||||
true,
|
||||
undefined,
|
||||
undefined,
|
||||
);
|
||||
} finally {
|
||||
globalConfig.executions.mode = 'regular';
|
||||
}
|
||||
});
|
||||
|
||||
it('uses recreateNodeExecutionStack to create a partial execution if a triggerToStartFrom with data is sent', async () => {
|
||||
// ARRANGE
|
||||
const activeExecutions = Container.get(ActiveExecutions);
|
||||
|
|
|
|||
|
|
@ -469,7 +469,7 @@ export class WorkflowRunner {
|
|||
executionId,
|
||||
workflowId,
|
||||
data,
|
||||
shouldReloadStaticData,
|
||||
loadStaticData,
|
||||
realtime,
|
||||
existingExecution?.executionId,
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user