MCPcopy Index your code
hub / github.com/rilldata/rill / start

Method start

cli/cmd/devtool/start.go:636–696  ·  view source on GitHub ↗
(ctx context.Context, verbose, reset bool, services *servicesCfg)

Source from the content-addressed store, hash-verified

634type local struct{}
635
636func (s local) start(ctx context.Context, verbose, reset bool, services *servicesCfg) error {
637 g, ctx := errgroup.WithContext(ctx)
638
639 if services.runtime {
640 g.Go(func() error { return s.runRuntime(ctx, verbose, reset) })
641 }
642
643 runtimeReadyCh := make(chan struct{})
644 g.Go(func() error {
645 if services.runtime {
646 err := s.awaitRuntime(ctx)
647 if err != nil {
648 return err
649 }
650 }
651 close(runtimeReadyCh)
652 return nil
653 })
654
655 if services.ui {
656 npmReadyCh := make(chan struct{})
657 g.Go(func() error {
658 err := s.runUIInstall(ctx)
659 if err != nil {
660 return err
661 }
662 close(npmReadyCh)
663 return nil
664 })
665
666 g.Go(func() error {
667 if err := awaitClose(ctx, runtimeReadyCh, npmReadyCh); err != nil {
668 return err
669 }
670 return s.runUI(ctx)
671 })
672 }
673
674 uiReadyCh := make(chan struct{})
675 g.Go(func() error {
676 if services.ui {
677 err := s.awaitUI(ctx)
678 if err != nil {
679 return err
680 }
681 }
682 close(uiReadyCh)
683 return nil
684 })
685
686 g.Go(func() error {
687 // Wait for runtime, then UI
688 if err := awaitClose(ctx, runtimeReadyCh, uiReadyCh); err != nil {
689 return err
690 }
691 logInfo.Printf("All services ready\n")
692 return nil
693 })

Callers

nothing calls this directly

Calls 7

runRuntimeMethod · 0.95
awaitRuntimeMethod · 0.95
runUIInstallMethod · 0.95
runUIMethod · 0.95
awaitUIMethod · 0.95
awaitCloseFunction · 0.85
PrintfMethod · 0.80

Tested by

no test coverage detected