Skip to content

Commit

Permalink
fix: properly exit loop when chan is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
chetan committed Nov 4, 2021
1 parent 96ab844 commit b7fd330
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions vhost.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ func (v *Vhost) Close() {
}

func (v *Vhost) populateLogBuffer() {
for {
line := <-v.logChan
for line := range v.logChan {
if v.logRing.Len() < 10 {
v.logRing.PushBack(line)
} else {
Expand Down

0 comments on commit b7fd330

Please sign in to comment.