fix shutdown stuck or panic

This commit is contained in:
yusing
2025-01-03 03:08:21 +08:00
parent 9f71fc2dd5
commit ba8705fb84
3 changed files with 12 additions and 8 deletions

View File

@@ -117,9 +117,7 @@ func (t *Task) finish(reason any) {
Strs("callbacks", t.listCallbacks()).
Msg("Timeout waiting for callbacks to finish")
}
if t.finished != nil {
close(t.finished)
}
close(t.finished)
if t == root {
return
}