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

fix: graceful shutdown (#1873)

This commit is contained in:
hoslo 2022-03-15 11:02:10 +08:00 committed by GitHub
parent 64bd619967
commit f68702a8c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

3
app.go
View File

@ -98,7 +98,8 @@ func (a *App) Run() error {
wg.Add(1)
eg.Go(func() error {
wg.Done()
return srv.Start(ctx)
tctx := NewContext(context.Background(), a)
return srv.Start(tctx)
})
}
wg.Wait()