fix: cli client (#92)
* fix: cli client * fix: print shutdown error correctly
This commit is contained in:
parent
602592d5f3
commit
5cd7bae505
2 changed files with 14 additions and 9 deletions
|
@ -97,7 +97,11 @@ func StartServer(ctx context.Context, port string) {
|
|||
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
err := server.Shutdown(ctx)
|
||||
log.Fatalf("Shutdown(): %v", err)
|
||||
ctxShutdown, cancelShutdown := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancelShutdown()
|
||||
err := server.Shutdown(ctxShutdown)
|
||||
if err != nil {
|
||||
log.Fatalf("Shutdown(): %v", err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue