From f44edacb30f19a6f00e394eb66b6f8e2d459be0b Mon Sep 17 00:00:00 2001 From: Victor Hadianto Date: Thu, 22 Feb 2024 07:59:33 +0000 Subject: [PATCH] wip --- internal/es/db/index.go | 2 +- internal/service/manager/manager.go | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) 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,