@@ -17,6 +17,17 @@ import {
1717if ( process . env [ "LOG_SERVER_CONFIGURATION" ] )
1818 console . log ( JSON . stringify ( services ) ) ;
1919
20+ const groupedServices = services . reduce ( ( acc , service ) => {
21+ // Create a unique key for the match pattern
22+ const matchKey = `${ normalizeObject ( service . match ) } ${ service . options . sendMatchesOnly || false } ` ;
23+ if ( ! acc [ matchKey ] ) {
24+ acc [ matchKey ] = [ ] ;
25+ }
26+ acc [ matchKey ] . push ( service ) ;
27+ return acc ;
28+ } , { } ) ;
29+
30+
2031app . get ( '/' , function ( req , res ) {
2132 res . status ( 200 ) ;
2233 res . send ( "Hello, delta notification is running" ) ;
@@ -75,17 +86,8 @@ function filterChangesestOnPattern(changeSets, entry) {
7586 return filteredChangesets ;
7687}
7788
78- async function informWatchers ( changeSets , res , muCallIdTrail , muSessionId ) {
79- const groupedServices = services . reduce ( ( acc , service ) => {
80- // Create a unique key for the match pattern
81- const matchKey = `${ normalizeObject ( service . match ) } ${ service . options . sendMatchesOnly || false } ` ;
82- if ( ! acc [ matchKey ] ) {
83- acc [ matchKey ] = [ ] ;
84- }
85- acc [ matchKey ] . push ( service ) ;
86- return acc ;
87- } , { } ) ;
8889
90+ async function informWatchers ( changeSets , res , muCallIdTrail , muSessionId ) {
8991 // Iterate over each unique match pattern
9092 for ( const matchKey in groupedServices ) {
9193 const firstEntry = groupedServices [ matchKey ] [ 0 ] ;
0 commit comments