diff --git a/internal/es/db/index.go b/internal/es/db/index.go index 1e731d1e9..2c01c1bc7 100644 --- a/internal/es/db/index.go +++ b/internal/es/db/index.go @@ -161,7 +161,7 @@ func GetFlowpipeConfig() (*flowpipeconfig.FlowpipeConfig, error) { flowpipeConfigCached, found := cache.GetCache().Get("#flowpipeconfig") if !found { - return flowpipeconfig.NewFlowpipeConfig(), nil + return nil, perr.BadRequestWithMessage("flowpipe config not found") } flowpipeConfig, ok := flowpipeConfigCached.(*flowpipeconfig.FlowpipeConfig) diff --git a/internal/service/manager/manager.go b/internal/service/manager/manager.go index f1f97a328..a70a30752 100644 --- a/internal/service/manager/manager.go +++ b/internal/service/manager/manager.go @@ -216,6 +216,15 @@ func (m *Manager) initializeResources() error { cache.GetCache().SetWithTTL("#flowpipeconfig", flowpipeConfig, 24*7*52*99*time.Hour) } + if m.shouldStartAPI() { + err := flowpipeConfig.SetupWatcher(context.TODO(), func(c context.Context, e error) { + + }) + if err != nil { + return err + } + } + w, errorAndWarning := workspace.LoadWorkspacePromptingForVariables( m.ctx, modLocation,