mirror of
https://github.com/yusing/godoxy.git
synced 2025-06-10 21:32:33 +02:00
fix(shutdown): change gracefulShutdown to call root.Finish directly instead of in a goroutine
This commit is contained in:
parent
b5328fe5e7
commit
cfa9201f82
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue