fix(task): revert to context based approach and fix tasks stuck, improve error handling

This commit is contained in:
yusing
2025-05-26 00:32:59 +08:00
parent 2e9f113224
commit 216c03c5ff
11 changed files with 200 additions and 183 deletions

View File

@@ -99,6 +99,11 @@ func (r *StreamRoute) HealthMonitor() health.HealthMonitor {
func (r *StreamRoute) acceptConnections() {
defer r.task.Finish("listener closed")
go func() {
<-r.task.Context().Done()
r.Close()
}()
for {
select {
case <-r.task.Context().Done():