fix: use MikroORM upsert
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 14 Jan 2024 12:10:54 +0000 (13:10 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 14 Jan 2024 12:10:54 +0000 (13:10 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/performance/storage/MikroOrmStorage.ts

index 9746c6bd5f5a09b439129338fc1dde2a1a82a013..a1cc7c8db99c38e0b217fd8a66cedef99a1944d5 100644 (file)
@@ -19,7 +19,7 @@ export class MikroOrmStorage extends Storage {
 
   public async storePerformanceStatistics (performanceStatistics: Statistics): Promise<void> {
     try {
-      await this.orm?.em.persistAndFlush({
+      await this.orm?.em.upsert({
         ...performanceStatistics,
         statisticsData: Array.from(performanceStatistics.statisticsData, ([name, value]) => ({
           name,