fix(auth): stop draining stream pool goroutines after context cancellation
This commit is contained in:
@@ -471,7 +471,10 @@ func (m *Manager) wrapStreamResult(ctx context.Context, auth *Auth, provider, ro
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for chunk := range remaining {
|
for chunk := range remaining {
|
||||||
_ = emit(chunk)
|
if ok := emit(chunk); !ok {
|
||||||
|
discardStreamChunks(remaining)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if !failed {
|
if !failed {
|
||||||
m.MarkResult(ctx, Result{AuthID: auth.ID, Provider: provider, Model: routeModel, Success: true})
|
m.MarkResult(ctx, Result{AuthID: auth.ID, Provider: provider, Model: routeModel, Success: true})
|
||||||
|
|||||||
Reference in New Issue
Block a user