fix(shutdown): change gracefulShutdown to call root.Finish directly instead of in a goroutine

This commit is contained in:
yusing 2025-06-09 22:20:49 +08:00
parent b5328fe5e7
commit cfa9201f82

View file

@ -85,7 +85,7 @@ func WaitExit(shutdownTimeout int) {
// still running when the timeout was reached, and their current tree
// of subtasks.
func gracefulShutdown(timeout time.Duration) error {
go root.Finish(ErrProgramExiting)
root.Finish(ErrProgramExiting)
if !root.waitFinish(timeout) {
return context.DeadlineExceeded
}