mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-18 11:02:54 +00:00
refactor: Replace manual map copy with maps.Copy in carrier-connector message queue
- Add maps import to mq.go - Replace manual for loop copying payload map with maps.Copy in PublishProfileEvent - Simplify map merging logic while maintaining same functionality
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"maps"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
@@ -125,9 +126,7 @@ func (mq *MessageQueue) PublishProfileEvent(eventType string, profileID string,
|
||||
},
|
||||
}
|
||||
|
||||
for k, v := range payload {
|
||||
msg.Payload[k] = v
|
||||
}
|
||||
maps.Copy(msg.Payload, payload)
|
||||
|
||||
return mq.Publish("profile-events", msg)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user