From 70b73ed697936ef696b7b29691b7bdd6a9418251 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 14 Jan 2024 13:10:54 +0100 Subject: [PATCH] fix: use MikroORM upsert MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/performance/storage/MikroOrmStorage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/performance/storage/MikroOrmStorage.ts b/src/performance/storage/MikroOrmStorage.ts index 9746c6bd..a1cc7c8d 100644 --- a/src/performance/storage/MikroOrmStorage.ts +++ b/src/performance/storage/MikroOrmStorage.ts @@ -19,7 +19,7 @@ export class MikroOrmStorage extends Storage { public async storePerformanceStatistics (performanceStatistics: Statistics): Promise { try { - await this.orm?.em.persistAndFlush({ + await this.orm?.em.upsert({ ...performanceStatistics, statisticsData: Array.from(performanceStatistics.statisticsData, ([name, value]) => ({ name, -- 2.34.1