Files
n8n-enterprise-unlocked/packages/cli/src/executions/executionHelpers.ts
कारतोफ्फेलस्क्रिप्ट™ be373bb859 Revert "feat(core): Read ephemeral license from environment and cleanup ee flags (#5797)" (#5816)
Revert "feat(core): Read ephemeral license from environment and clean up ee flags (#5797)"

This reverts commit a81ca7c19c.
2023-03-29 18:00:29 +02:00

30 lines
832 B
TypeScript

import { Container } from 'typedi';
import type { IExecutionFlattedDb } from '@/Interfaces';
import type { ExecutionStatus } from 'n8n-workflow';
import { License } from '@/License';
import config from '@/config';
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';
}
}
export function isAdvancedExecutionFiltersEnabled(): boolean {
const license = Container.get(License);
return (
config.getEnv('enterprise.features.advancedExecutionFilters') ||
license.isAdvancedExecutionFiltersEnabled()
);
}