mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 21:37:32 -08:00
refactor(core): Remove license from execution repository (no-changelog) (#9726)
This commit is contained in:
parent
58f00bbacd
commit
6a43710859
|
@ -35,7 +35,6 @@ import type {
|
||||||
} from '@/Interfaces';
|
} from '@/Interfaces';
|
||||||
|
|
||||||
import config from '@/config';
|
import config from '@/config';
|
||||||
import { isAdvancedExecutionFiltersEnabled } from '@/executions/executionHelpers';
|
|
||||||
import type { ExecutionData } from '../entities/ExecutionData';
|
import type { ExecutionData } from '../entities/ExecutionData';
|
||||||
import { ExecutionEntity } from '../entities/ExecutionEntity';
|
import { ExecutionEntity } from '../entities/ExecutionEntity';
|
||||||
import { ExecutionMetadata } from '../entities/ExecutionMetadata';
|
import { ExecutionMetadata } from '../entities/ExecutionMetadata';
|
||||||
|
@ -70,7 +69,7 @@ function parseFiltersToQueryBuilder(
|
||||||
if (filters?.finished) {
|
if (filters?.finished) {
|
||||||
qb.andWhere({ finished: filters.finished });
|
qb.andWhere({ finished: filters.finished });
|
||||||
}
|
}
|
||||||
if (filters?.metadata && isAdvancedExecutionFiltersEnabled()) {
|
if (filters?.metadata) {
|
||||||
qb.leftJoin(ExecutionMetadata, 'md', 'md.executionId = execution.id');
|
qb.leftJoin(ExecutionMetadata, 'md', 'md.executionId = execution.id');
|
||||||
for (const md of filters.metadata) {
|
for (const md of filters.metadata) {
|
||||||
qb.andWhere('md.key = :key AND md.value = :value', md);
|
qb.andWhere('md.key = :key AND md.value = :value', md);
|
||||||
|
|
|
@ -40,6 +40,7 @@ import type { ExecutionEntity } from '@/databases/entities/ExecutionEntity';
|
||||||
import { QueuedExecutionRetryError } from '@/errors/queued-execution-retry.error';
|
import { QueuedExecutionRetryError } from '@/errors/queued-execution-retry.error';
|
||||||
import { ConcurrencyControlService } from '@/concurrency/concurrency-control.service';
|
import { ConcurrencyControlService } from '@/concurrency/concurrency-control.service';
|
||||||
import { AbortedExecutionRetryError } from '@/errors/aborted-execution-retry.error';
|
import { AbortedExecutionRetryError } from '@/errors/aborted-execution-retry.error';
|
||||||
|
import { License } from '@/License';
|
||||||
|
|
||||||
export const schemaGetExecutionsQueryFilter = {
|
export const schemaGetExecutionsQueryFilter = {
|
||||||
$id: '/IGetExecutionsQueryFilter',
|
$id: '/IGetExecutionsQueryFilter',
|
||||||
|
@ -90,6 +91,7 @@ export class ExecutionService {
|
||||||
private readonly waitTracker: WaitTracker,
|
private readonly waitTracker: WaitTracker,
|
||||||
private readonly workflowRunner: WorkflowRunner,
|
private readonly workflowRunner: WorkflowRunner,
|
||||||
private readonly concurrencyControl: ConcurrencyControlService,
|
private readonly concurrencyControl: ConcurrencyControlService,
|
||||||
|
private readonly license: License,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
async findOne(
|
async findOne(
|
||||||
|
@ -249,6 +251,10 @@ export class ExecutionService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (requestFilters?.metadata && !this.license.isAdvancedExecutionFiltersEnabled()) {
|
||||||
|
delete requestFilters.metadata;
|
||||||
|
}
|
||||||
|
|
||||||
await this.executionRepository.deleteExecutionsByFilter(requestFilters, sharedWorkflowIds, {
|
await this.executionRepository.deleteExecutionsByFilter(requestFilters, sharedWorkflowIds, {
|
||||||
deleteBefore,
|
deleteBefore,
|
||||||
ids,
|
ids,
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import { Container } from 'typedi';
|
|
||||||
import type { ExecutionStatus } from 'n8n-workflow';
|
import type { ExecutionStatus } from 'n8n-workflow';
|
||||||
import { License } from '@/License';
|
|
||||||
import type { IExecutionFlattedDb, IExecutionResponse } from '@/Interfaces';
|
import type { IExecutionFlattedDb, IExecutionResponse } from '@/Interfaces';
|
||||||
|
|
||||||
export function getStatusUsingPreviousExecutionStatusMethod(
|
export function getStatusUsingPreviousExecutionStatusMethod(
|
||||||
|
@ -18,8 +16,3 @@ export function getStatusUsingPreviousExecutionStatusMethod(
|
||||||
return 'unknown';
|
return 'unknown';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isAdvancedExecutionFiltersEnabled(): boolean {
|
|
||||||
const license = Container.get(License);
|
|
||||||
return license.isAdvancedExecutionFiltersEnabled();
|
|
||||||
}
|
|
||||||
|
|
|
@ -16,6 +16,8 @@ describe('ExecutionService', () => {
|
||||||
mock(),
|
mock(),
|
||||||
mock(),
|
mock(),
|
||||||
mock(),
|
mock(),
|
||||||
|
mock(),
|
||||||
|
mock(),
|
||||||
);
|
);
|
||||||
|
|
||||||
it('should error on retrying an aborted execution', async () => {
|
it('should error on retrying an aborted execution', async () => {
|
||||||
|
|
Loading…
Reference in a new issue