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

Method updateProjectConfig

runtime/registry.go:615–642  ·  view source on GitHub ↗

updateProjectConfig updates the project config for the given instance. This does the same operation as ProjectParserReconciler's reconcileProjectConfig and is done before starting the controller to ensure that when controller first starts, it doesn’t immediately restart due to changed variables

(iwc *instanceWithController)

Source from the content-addressed store, hash-verified

613// This does the same operation as ProjectParserReconciler's reconcileProjectConfig and is done before starting the controller
614// to ensure that when controller first starts, it doesn’t immediately restart due to changed variables
615func (r *registryCache) updateProjectConfig(iwc *instanceWithController) error {
616 repo, release, err := r.rt.Repo(iwc.ctx, iwc.instanceID)
617 if err != nil {
618 return err
619 }
620 defer release()
621
622 instance, err := r.get(iwc.instanceID)
623 if err != nil {
624 return err
625 }
626
627 cfg, err := instance.Config()
628 if err != nil {
629 return err
630 }
631 p, err := parser.Parse(iwc.ctx, repo, iwc.instanceID, instance.Environment, instance.OLAPConnector, cfg.StrictResolverProps)
632 if err != nil {
633 return err
634 }
635
636 if p.RillYAML == nil {
637 // Empty project
638 return nil
639 }
640
641 return r.rt.UpdateInstanceWithRillYAML(iwc.ctx, iwc.instanceID, p, false)
642}
643
644func sizeOfDir(path string) int64 {
645 var size int64

Callers 1

restartControllerMethod · 0.95

Calls 5

getMethod · 0.95
ParseFunction · 0.92
RepoMethod · 0.80
ConfigMethod · 0.65

Tested by

no test coverage detected