fix: cli client

This commit is contained in:
Elio Bischof 2021-04-07 16:51:07 +02:00
parent 602592d5f3
commit f0e1b3076f
No known key found for this signature in database
GPG key ID: 7B383FDE4DDBF1BD
2 changed files with 14 additions and 9 deletions

View file

@ -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(): %w", err)
}
}()
}