Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
fix: missed first stream frame
Browse files Browse the repository at this point in the history
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
  • Loading branch information
rustatian committed Aug 19, 2023
1 parent 388ac55 commit d4175c2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pool/static_pool/workers_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ begin:
sp.ww.Release(w)
}()

// send the initial frame
resp <- newPExec(rsp, nil)

// stream iterator
for {
select {
Expand All @@ -241,14 +244,15 @@ begin:
}
runtime.Goexit()
default:
pld, next, err := w.StreamIter()
if err != nil {
resp <- newPExec(nil, err) // exit from the goroutine
pld, next, errI := w.StreamIter()
if errI != nil {
resp <- newPExec(nil, errI) // exit from the goroutine
runtime.Goexit()
}

resp <- newPExec(pld, nil)
if !next {
// we've got the last frame
runtime.Goexit()
}
}
Expand Down

0 comments on commit d4175c2

Please sign in to comment.