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 @@ -1151,14 +1151,17 @@ func HandleGetOrg(resp http.ResponseWriter, request *http.Request) {
11511151 }
11521152 }
11531153
1154- if project.Environment == "onprem" && org.Created > 0 {
1155-
1156- nowUnix := time.Now().Unix()
1157-
1158- thirtyDays := int64(30 * 24 * 60 * 60)
1159- isAfter30Days := nowUnix >= org.Created+thirtyDays
1154+ if project.Environment == "onprem" {
11601155
1161- org.OldOrg = isAfter30Days
1156+ statistics, err := GetOrgStatistics(ctx, org.Id)
1157+ if err != nil {
1158+ log.Printf("[ERROR] Failed getting org statistics for %s: %s", org.Id, err)
1159+ } else {
1160+ totalWorkflowExecutions := statistics.TotalWorkflowExecutions + statistics.TotalChildWorkflowExecutions
1161+ if totalWorkflowExecutions > int64(5000) {
1162+ org.OldOrg = true
1163+ }
1164+ }
11621165 }
11631166
11641167 // 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