fix(core): Fix execution status filters (#5533)

* fix status filters

* fix countfilter

* add migrations to backfill status

* fix migrations
This commit is contained in:
Michael Auerswald
2023-02-21 21:44:46 +01:00
committed by GitHub
parent 52f740b9e8
commit 17eff4d7d6
12 changed files with 135 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
import type { IExecutionFlattedDb } from '../Interfaces';
import type { ExecutionStatus } from 'n8n-workflow';
export function getStatusUsingPreviousExecutionStatusMethod(
execution: IExecutionFlattedDb,
): ExecutionStatus {
if (execution.waitTill) {
return 'waiting';
} else if (execution.stoppedAt === undefined) {
return 'running';
} else if (execution.finished) {
return 'success';
} else if (execution.stoppedAt !== null) {
return 'failed';
} else {
return 'unknown';
}
}