Skip to content

Commit

Permalink
another try to remove job observer leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
vintikzzz committed Oct 8, 2024
1 parent 2247001 commit ae47dea
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion services/job/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,17 @@ func (s *Observer) Close() {
s.mux.Lock()
defer s.mux.Unlock()
if !s.closed {
s.closed = true
close(s.C)
s.closed = true
}
}

func (s *Observer) isClosed() bool {
s.mux.Lock()
defer s.mux.Unlock()
return s.closed
}

func (s *Observer) Push(v LogItem) {
if !s.closed {
s.C <- v
Expand Down

0 comments on commit ae47dea

Please sign in to comment.