From 6296685b99eedeac3ce619aa8d22cd466f35c449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Tue, 12 Dec 2023 13:44:21 +0100 Subject: [PATCH] just use this.insert, it does not use transactions either --- .../repositories/execution.repository.ts | 27 +++++-------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/packages/cli/src/databases/repositories/execution.repository.ts b/packages/cli/src/databases/repositories/execution.repository.ts index 90c449d507666..7598ff788f922 100644 --- a/packages/cli/src/databases/repositories/execution.repository.ts +++ b/packages/cli/src/databases/repositories/execution.repository.ts @@ -25,7 +25,7 @@ import type { import config from '@/config'; import type { IGetExecutionsQueryFilter } from '@/executions/executions.service'; import { isAdvancedExecutionFiltersEnabled } from '@/executions/executionHelpers'; -import { ExecutionData } from '../entities/ExecutionData'; +import type { ExecutionData } from '../entities/ExecutionData'; import { ExecutionEntity } from '../entities/ExecutionEntity'; import { ExecutionMetadata } from '../entities/ExecutionMetadata'; import { ExecutionDataRepository } from './executionData.repository'; @@ -215,27 +215,14 @@ export class ExecutionRepository extends Repository { async createNewExecution(execution: ExecutionPayload): Promise { const { data, workflowData, ...rest } = execution; - const { identifiers: inserted } = await this.manager - .createQueryBuilder() - .insert() - .into(ExecutionEntity) - .values([rest]) - .execute(); - + const { identifiers: inserted } = await this.insert(rest); const { id: executionId } = inserted[0] as { id: string }; const { connections, nodes, name } = workflowData ?? {}; - await this.manager - .createQueryBuilder() - .insert() - .into(ExecutionData) - .values([ - { - executionId, - workflowData: { connections, nodes, name }, - data: stringify(data), - }, - ]) - .execute(); + await this.executionDataRepository.insert({ + executionId, + workflowData: { connections, nodes, name }, + data: stringify(data), + }); return String(executionId); }