don't leak a go routine in the error case

This commit is contained in:
Andy Arthur
2021-06-24 16:44:07 -07:00
parent ece72c38a2
commit 0d1d697058
+4 -6
View File
@@ -305,12 +305,10 @@ func (p *Puller) Pull(ctx context.Context) error {
}
}
}
if ae.IsSet() {
return ae.Get()
}
if p.wr.Size() > 0 {
completedTables <- FilledWriters{p.wr}
if !ae.IsSet() {
if p.wr.Size() > 0 {
completedTables <- FilledWriters{p.wr}
}
}
close(completedTables)