performance improvement
parent
a11fc2cd5c
commit
438b4bee01
|
@ -65,15 +65,15 @@ func AddLog(body structs.LogBody) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
marshaledLogs, err := json.Marshal(body.Logs)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
for clientId, sseClient := range cache.SSEClients {
|
for clientId, sseClient := range cache.SSEClients {
|
||||||
if sseClient.LogType == body.Type && sseClient.Date == date {
|
if sseClient.LogType == body.Type && sseClient.Date == date {
|
||||||
marshaledLogs, err := json.Marshal(body.Logs)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
sseClient.MessageChannel <- structs.SSEClientChannelMessage{
|
sseClient.MessageChannel <- structs.SSEClientChannelMessage{
|
||||||
ClientId: clientId,
|
ClientId: clientId,
|
||||||
Message: marshaledLogs,
|
Message: marshaledLogs,
|
||||||
|
|
Loading…
Reference in New Issue