Skip to content

Commit

Permalink
chore: add a schemaservice.New() function
Browse files Browse the repository at this point in the history
  • Loading branch information
alecthomas committed Nov 18, 2024
1 parent da49e85 commit 8880729
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions v2/backend/schemaservice/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ func Start(ctx context.Context, config Config) error {
if err != nil {
return fmt.Errorf("failed to initialise observability: %w", err)
}
svc := &Service{
changes: pubsub.New[deploymentChange](),
state: NewState(),
}
svc := New()
logger.Debugf("Starting SchemaService on %s", config.Bind)
err = rpc.Serve(ctx, config.Bind,
rpc.GRPC(ftlpbconnect.NewSchemaServiceHandler, svc),
Expand All @@ -69,6 +66,13 @@ func Start(ctx context.Context, config Config) error {
return nil
}

func New() *Service {
return &Service{
state: NewState(),
changes: pubsub.New[deploymentChange](),
}
}

var _ ftlpbconnect.SchemaServiceHandler = (*Service)(nil)

func (s *Service) healthCheck(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit 8880729

Please sign in to comment.