1
0

2 Commity 073a295206 ... f4341f03d3

Autor SHA1 Správa Dátum
  FAMBL f4341f03d3 Merge changes. 1 rok pred
  FAMBL ea1d9ac19d Fixed lodash. 1 rok pred
1 zmenil súbory, kde vykonal 15 pridanie a 9 odobranie
  1. 15 9
      services/message-auditor.service.ts

+ 15 - 9
services/message-auditor.service.ts

@@ -4,6 +4,7 @@ import { MessageLog } from "../dependencies/log/type/datatype";
 import * as _ from 'lodash'
 import { LoggingService } from "../dependencies/log/interface/export";
 import { BaseMessage } from "../dependencies/log/dependencies/msgutil/interface/export";
+let processedMsgIds = new Set();
 require('dotenv').config();
 
 export class MessageAuditorService implements MessageAuditorServiceInterface {
@@ -97,6 +98,13 @@ export class MessageAuditorService implements MessageAuditorServiceInterface {
                 console.log("Record set 2: ", _.keys(_.countBy(data.arr2,function(data:MessageLog){return data.appData['msgId']})).length);
             }
 
+
+            if(process.env.CheckAudit)
+            {
+                console.log("[CheckAudit] Record set 1: ", _.keys(_.countBy(data.arr1,function(data:MessageLog){return data.appData['msgId']})).length);
+                console.log("[CheckAudit] Record set 2: ", _.keys(_.countBy(data.arr2,function(data:MessageLog){return data.appData['msgId']})).length);
+            }
+
             this.checkArrayDifferences(data).then((data: MessageLog[]) => {
 
                 if(process.env.CheckAudit)
@@ -203,15 +211,13 @@ export class MessageAuditorService implements MessageAuditorServiceInterface {
     // Notification message may have multiple nested data properties that maybe in string format
     private checkIfIsInPayloadDataFormat(payload: BaseMessage | any) {
         let parsedData: any
-        if(payload.data.data){
-            if (payload.data.data.data && typeof payload.data.data.data === 'string') {
-                parsedData = JSON.parse(payload.data.data.data)
-                // console.log(parsedData)
-                payload.data.data.data = parsedData
-                return payload
-            } else {
-                return payload
-            }
+        if (payload.data
+            && payload.data.data
+            && payload.data.data.data && typeof payload.data.data.data === 'string') {
+            parsedData = JSON.parse(payload.data.data.data)
+            // console.log(parsedData)
+            payload.data.data.data = parsedData
+            return payload
         } else {
             return payload
         }