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 3638669 commit 4061fd3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions services/job/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,13 @@ func (s *Jobs) Log(ctx context.Context, id string) (c chan LogItem, err error) {
select {
case <-ctx.Done():
close(c)
close(o.C)
return
case i := <-o.C:
c <- i
if i.Level == Close {
close(c)
close(o.C)
return
}
}
Expand Down

0 comments on commit 4061fd3

Please sign in to comment.