Skip to content

Commit

Permalink
name mutex
Browse files Browse the repository at this point in the history
  • Loading branch information
tedim52 committed Aug 9, 2024
1 parent 0883f39 commit dc9d1d1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions engine/server/engine/centralized_logs/logline/logline_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type LogLineSender struct {

logLineBuffer map[service.ServiceUUID][]LogLine

sync.Mutex
mu sync.Mutex
}

func NewLogLineSender() *LogLineSender {
Expand All @@ -26,8 +26,8 @@ func NewLogLineSender() *LogLineSender {
}

func (sender *LogLineSender) SendLogLine(serviceUuid service.ServiceUUID, logLine LogLine) {
sender.Mutex.Lock()
defer sender.Mutex.Unlock()
sender.mu.Lock()
defer sender.mu.Unlock()

sender.logLineBuffer[serviceUuid] = append(sender.logLineBuffer[serviceUuid], logLine)

Expand All @@ -49,8 +49,8 @@ func (sender *LogLineSender) GetLogsChannel() chan map[service.ServiceUUID][]Log
// sends all logs remaining in the buffers through the channel
// this should be called at the end of processing to send the remainder of logs
func (sender *LogLineSender) Flush() {
sender.Mutex.Lock()
defer sender.Mutex.Unlock()
sender.mu.Lock()
defer sender.mu.Unlock()

for uuid, logLines := range sender.logLineBuffer {
serviceUuid := uuid
Expand Down

0 comments on commit dc9d1d1

Please sign in to comment.