File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -1152,14 +1152,17 @@ func HandleGetOrg(resp http.ResponseWriter, request *http.Request) {
11521152 }
11531153 }
11541154
1155- if project.Environment == "onprem" && org.Created > 0 {
1156-
1157- nowUnix := time.Now().Unix()
1158-
1159- thirtyDays := int64(30 * 24 * 60 * 60)
1160- isAfter30Days := nowUnix >= org.Created+thirtyDays
1155+ if project.Environment == "onprem" {
11611156
1162- org.OldOrg = isAfter30Days
1157+ statistics, err := GetOrgStatistics(ctx, org.Id)
1158+ if err != nil {
1159+ log.Printf("[ERROR] Failed getting org statistics for %s: %s", org.Id, err)
1160+ } else {
1161+ totalWorkflowExecutions := statistics.TotalWorkflowExecutions + statistics.TotalChildWorkflowExecutions
1162+ if totalWorkflowExecutions > int64(5000) {
1163+ org.OldOrg = true
1164+ }
1165+ }
11631166 }
11641167
11651168 // Make sure to add all orgs that are childs IF you have access
You can’t perform that action at this time.
0 commit comments