1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-28 03:57:02 +02:00

fix: sctx cause request ctx canceled during graceful shutdown (#3097)

This commit is contained in:
LinEvil 2023-12-01 13:37:42 +08:00 committed by GitHub
parent 396af2d25f
commit abd1d354af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
app.go
View File

@ -109,7 +109,7 @@ func (a *App) Run() error {
wg.Add(1)
eg.Go(func() error {
wg.Done() // here is to ensure server start has begun running before register, so defer is not needed
return srv.Start(sctx)
return srv.Start(NewContext(a.opts.ctx, a))
})
}
wg.Wait()