Skip to content

Commit

Permalink
Remove unnecessary validation when constructing new Service
Browse files Browse the repository at this point in the history
  • Loading branch information
ycombinator committed Jan 17, 2024
1 parent b3ad709 commit 8729b39
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,6 @@ func New(ctx context.Context, set Settings, cfg Config) (*Service, error) {
srv.telemetrySettings.MeterProvider = srv.telemetryInitializer.mp
srv.telemetrySettings.TracerProvider = srv.telemetryInitializer.tp

// validate the configuration
if err := validate(ctx, set, cfg, srv.telemetrySettings); err != nil {
return nil, err
}

// process the configuration and initialize the pipeline
if err = srv.initExtensionsAndPipeline(ctx, set, cfg); err != nil {
// If pipeline initialization fails then shut down the telemetry server
Expand All @@ -151,10 +146,6 @@ func Validate(ctx context.Context, set Settings, cfg Config) error {
MeterProvider: noop.NewMeterProvider(),
}

return validate(ctx, set, cfg, telSettings)
}

func validate(ctx context.Context, set Settings, cfg Config, telSettings servicetelemetry.TelemetrySettings) error {
pSet := graph.Settings{
Telemetry: telSettings,
BuildInfo: set.BuildInfo,
Expand Down

0 comments on commit 8729b39

Please sign in to comment.