Cleaned up a bit

This commit is contained in:
2024-06-04 16:07:13 -06:00
parent e668d62b57
commit e57121715e
2 changed files with 9 additions and 9 deletions

View File

@ -52,15 +52,15 @@ func (s *SSEServerType) ClientCount(channel string) int {
return len(s.clients[channel])
}
func SendSSE(channel string, message string) error {
SSEServer.mu.Lock()
defer SSEServer.mu.Unlock()
func (s *SSEServerType) SendSSE(channel string, message string) {
s.mu.Lock()
defer s.mu.Unlock()
for client := range SSEServer.clients[channel] {
client <- message
}
go func() {
for client := range s.clients[channel] {
client <- message
}
}()
LogDebug.Printf("\nMessage broadcast on channel %s: %s\n", channel, message)
return nil
}