refactor(core): Remove license from execution repository (no-changelog) (#9726)
This commit is contained in:
@@ -35,7 +35,6 @@ import type {
|
||||
} from '@/Interfaces';
|
||||
|
||||
import config from '@/config';
|
||||
import { isAdvancedExecutionFiltersEnabled } from '@/executions/executionHelpers';
|
||||
import type { ExecutionData } from '../entities/ExecutionData';
|
||||
import { ExecutionEntity } from '../entities/ExecutionEntity';
|
||||
import { ExecutionMetadata } from '../entities/ExecutionMetadata';
|
||||
@@ -70,7 +69,7 @@ function parseFiltersToQueryBuilder(
|
||||
if (filters?.finished) {
|
||||
qb.andWhere({ finished: filters.finished });
|
||||
}
|
||||
if (filters?.metadata && isAdvancedExecutionFiltersEnabled()) {
|
||||
if (filters?.metadata) {
|
||||
qb.leftJoin(ExecutionMetadata, 'md', 'md.executionId = execution.id');
|
||||
for (const md of filters.metadata) {
|
||||
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 { ConcurrencyControlService } from '@/concurrency/concurrency-control.service';
|
||||
import { AbortedExecutionRetryError } from '@/errors/aborted-execution-retry.error';
|
||||
import { License } from '@/License';
|
||||
|
||||
export const schemaGetExecutionsQueryFilter = {
|
||||
$id: '/IGetExecutionsQueryFilter',
|
||||
@@ -90,6 +91,7 @@ export class ExecutionService {
|
||||
private readonly waitTracker: WaitTracker,
|
||||
private readonly workflowRunner: WorkflowRunner,
|
||||
private readonly concurrencyControl: ConcurrencyControlService,
|
||||
private readonly license: License,
|
||||
) {}
|
||||
|
||||
async findOne(
|
||||
@@ -249,6 +251,10 @@ export class ExecutionService {
|
||||
}
|
||||
}
|
||||
|
||||
if (requestFilters?.metadata && !this.license.isAdvancedExecutionFiltersEnabled()) {
|
||||
delete requestFilters.metadata;
|
||||
}
|
||||
|
||||
await this.executionRepository.deleteExecutionsByFilter(requestFilters, sharedWorkflowIds, {
|
||||
deleteBefore,
|
||||
ids,
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { Container } from 'typedi';
|
||||
import type { ExecutionStatus } from 'n8n-workflow';
|
||||
import { License } from '@/License';
|
||||
import type { IExecutionFlattedDb, IExecutionResponse } from '@/Interfaces';
|
||||
|
||||
export function getStatusUsingPreviousExecutionStatusMethod(
|
||||
@@ -18,8 +16,3 @@ export function getStatusUsingPreviousExecutionStatusMethod(
|
||||
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(),
|
||||
);
|
||||
|
||||
it('should error on retrying an aborted execution', async () => {
|
||||
|
||||
Reference in New Issue
Block a user