From: Jérôme Benoit Date: Sun, 14 Jan 2024 12:10:54 +0000 (+0100) Subject: fix: use MikroORM upsert X-Git-Tag: v1.2.32~9 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=70b73ed697936ef696b7b29691b7bdd6a9418251;p=e-mobility-charging-stations-simulator.git fix: use MikroORM upsert Signed-off-by: Jérôme Benoit --- 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,