Skip to content

Commit

Permalink
Fix panic closing logs channel
Browse files Browse the repository at this point in the history
  • Loading branch information
joyrex2001 committed Jul 19, 2021
1 parent 56860e0 commit 6ee6708
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/backend/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func (in *instance) GetLogs(tainr *types.Container, follow bool, count int, stop
defer stream.Close()

stopL := make(chan struct{}, 1)
defer close(stopL)

if follow {
go func() {
Expand All @@ -51,6 +50,7 @@ func (in *instance) GetLogs(tainr *types.Container, follow bool, count int, stop
// close when container is done
select {
case <-stopL:
close(stopL)
return nil
default:
}
Expand Down

0 comments on commit 6ee6708

Please sign in to comment.