Browse Source

Merge pull request #55 from thaJeztah/18.09_backport_fix-progress-panic

[18.09] backport pkg/progress: work around closing closed channel panic
Tibor Vass 6 năm trước cách đây
mục cha
commit
c24fd7a2c3
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      pkg/progress/progress.go

+ 4 - 0
pkg/progress/progress.go

@@ -39,6 +39,10 @@ type Output interface {
 type chanOutput chan<- Progress
 
 func (out chanOutput) WriteProgress(p Progress) error {
+	// FIXME: workaround for panic in #37735
+	defer func() {
+		recover()
+	}()
 	out <- p
 	return nil
 }