We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70b6863 commit 61335f5Copy full SHA for 61335f5
internal/query/result.go
@@ -139,6 +139,10 @@ func newResult(
139
140
r.closeOnce = sync.OnceFunc(func() {
141
close(closed)
142
+
143
+ for i := range r.onClose {
144
+ r.onClose[len(r.onClose)-i-1]()
145
+ }
146
})
147
148
if r.trace != nil {
@@ -231,13 +235,7 @@ func (r *streamResult) Close(ctx context.Context) (finalErr error) {
231
235
}()
232
236
}
233
237
234
- defer func() {
- r.closeOnce()
-
- for i := range r.onClose {
238
- r.onClose[len(r.onClose)-i-1]()
239
- }
240
- }()
+ defer r.closeOnce()
241
242
for {
243
select {
0 commit comments