From 2d780192c380b317002145855ba01d72a639493e Mon Sep 17 00:00:00 2001 From: "lalitdeore12@gmail.com" Date: Fri, 3 Oct 2025 18:38:37 +0530 Subject: [PATCH] Fail org loading base on the timestamp --- backend/go-app/main.go | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/backend/go-app/main.go b/backend/go-app/main.go index b00a1628..17817cd5 100755 --- a/backend/go-app/main.go +++ b/backend/go-app/main.go @@ -943,9 +943,22 @@ func handleInfo(resp http.ResponseWriter, request *http.Request) { childOrgs = []shuffle.Org{} } } - // Change this deadline date as release date while pushing to production - deadline := time.Date(2025, 10, 5, 0, 0, 0, 0, time.UTC).Unix() - if len(org.CreatorOrg) > 0 && len(childOrgs) > 3 && org.Created >= deadline { + + failToLoadOrgs := []string{} + sort.Slice(childOrgs, func(i, j int) bool { + return childOrgs[i].Created < childOrgs[j].Created + }) + + for index, org := range childOrgs { + + if index < 3 { + continue + } + + failToLoadOrgs = append(failToLoadOrgs, org.Id) + } + + if len(org.CreatorOrg) > 0 && len(childOrgs) > 3 && shuffle.ArrayContains(failToLoadOrgs, userInfo.ActiveOrg.Id) { parentOrg, err := shuffle.GetOrg(ctx, org.CreatorOrg) if err != nil { log.Printf("[ERROR] Failed to get parent org during getinfo: %s", err)