fix broken startup on disabled servers

This commit is contained in:
2025-03-30 11:27:41 -04:00
parent 5c26accc34
commit 4f0c5fe665
3 changed files with 33 additions and 9 deletions

View File

@ -44,13 +44,11 @@ func (a *App) MustRun() {
// Prepare GRPC first. The GRPC server may update its opts
// with a prepared GRPC-Gateway runtime.ServeMux if any of its services
// have added GRPC-Gateway handlers. If present, serve under api path
if a.cfg.GRPCEnabled() {
a.runGRPC(ctx)
}
a.runGRPC(ctx)
if a.cfg.HTTPEnabled() {
a.runHTTP(ctx)
}
// Second, prepare and run HTTP server, embedding grpc-gateway
// runtime.ServeMux if set by runGRPC()
a.runHTTP(ctx)
// Monitor app lifecycle
go a.monitor()