mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-27 11:31:06 +01:00
fix(shutdown): change gracefulShutdown to call root.Finish directly instead of in a goroutine
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user