fix broken startup on disabled servers
This commit is contained in:
@ -3,12 +3,26 @@ package app
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/codes"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
|
||||
optshttp "gitea.libretechconsulting.com/rmcguire/go-app/pkg/srv/http/opts"
|
||||
)
|
||||
|
||||
func (a *App) runHTTP(ctx context.Context) {
|
||||
if a.HTTP == nil {
|
||||
a.HTTP = &optshttp.AppHTTP{
|
||||
HTTPDone: make(chan any),
|
||||
}
|
||||
}
|
||||
|
||||
if !a.cfg.HTTPEnabled() {
|
||||
zerolog.Ctx(ctx).Info().Msg("skipping disabled HTTP Server")
|
||||
return
|
||||
}
|
||||
|
||||
span := trace.SpanFromContext(ctx)
|
||||
if err := a.initHTTP(ctx); err != nil {
|
||||
span.RecordError(err)
|
||||
|
Reference in New Issue
Block a user