diff --git a/modules/loghandler/loghandler.go b/modules/loghandler/loghandler.go index 1a0336e..6490815 100644 --- a/modules/loghandler/loghandler.go +++ b/modules/loghandler/loghandler.go @@ -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 { 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{ ClientId: clientId, Message: marshaledLogs,