mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-25 09:48:32 +02: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
|
// still running when the timeout was reached, and their current tree
|
||||||
// of subtasks.
|
// of subtasks.
|
||||||
func gracefulShutdown(timeout time.Duration) error {
|
func gracefulShutdown(timeout time.Duration) error {
|
||||||
go root.Finish(ErrProgramExiting)
|
root.Finish(ErrProgramExiting)
|
||||||
if !root.waitFinish(timeout) {
|
if !root.waitFinish(timeout) {
|
||||||
return context.DeadlineExceeded
|
return context.DeadlineExceeded
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user