refactor(core): Separate execution startedAt from createdAt (#10810)

This commit is contained in:
Iván Ovejero
2024-09-27 13:32:12 +02:00
committed by GitHub
parent bf7392a878
commit afda049491
26 changed files with 163 additions and 38 deletions

View File

@@ -70,6 +70,7 @@ describe('ExecutionService', () => {
mode: expect.any(String),
retryOf: null,
status: expect.any(String),
createdAt: expect.any(String),
startedAt: expect.any(String),
stoppedAt: expect.any(String),
waitTill: null,
@@ -510,6 +511,7 @@ describe('ExecutionService', () => {
mode: expect.any(String),
retryOf: null,
status: expect.any(String),
createdAt: expect.any(String),
startedAt: expect.any(String),
stoppedAt: expect.any(String),
waitTill: null,

View File

@@ -159,6 +159,7 @@ test('should report credential in not recently executed workflow', async () => {
const savedExecution = await Container.get(ExecutionRepository).save({
finished: true,
mode: 'manual',
createdAt: date,
startedAt: date,
stoppedAt: date,
workflowId: workflow.id,
@@ -227,6 +228,7 @@ test('should not report credentials in recently executed workflow', async () =>
const savedExecution = await Container.get(ExecutionRepository).save({
finished: true,
mode: 'manual',
createdAt: date,
startedAt: date,
stoppedAt: date,
workflowId: workflow.id,

View File

@@ -39,6 +39,7 @@ export async function createExecution(
const execution = await Container.get(ExecutionRepository).save({
finished: finished ?? true,
mode: mode ?? 'manual',
createdAt: new Date(),
startedAt: startedAt ?? new Date(),
...(workflow !== undefined && { workflowId: workflow.id }),
stoppedAt: stoppedAt ?? new Date(),