From 2d60568ab73e445121295c6b93de99669f124900 Mon Sep 17 00:00:00 2001 From: yashsinghcodes Date: Wed, 26 Nov 2025 13:55:47 +0530 Subject: [PATCH] fix: warnings and error related to opensearch index --- db-connector.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/db-connector.go b/db-connector.go index f1b8d7c8..41cc8607 100755 --- a/db-connector.go +++ b/db-connector.go @@ -6416,6 +6416,13 @@ func GetEnvironments(ctx context.Context, orgId string) ([]Environment, error) { hideEnvs := false multiEnvLimit := 0 if project.Environment == "onprem" { + if orgId == "" { + if debug { + log.Printf("[DEBUG] No orgId provided, skipping multi-env license check") + } + return environments, nil + } + currentOrg, err := GetOrg(ctx, orgId) if err != nil { log.Printf("[WARNING] Failed to get current org %s: %v", orgId, err) @@ -17089,7 +17096,7 @@ func InitOpensearchIndexes() { GetESIndexPrefix("notifications"), GetESIndexPrefix("shuffle_logs"), GetESIndexPrefix("environments"), - GetESIndexPrefix("notifications"), + GetESIndexPrefix("org_statistics") } customConfig := os.Getenv("OPENSEARCH_INDEX_CONFIG")