Skip to content

Commit e6772c0

Browse files
authored
Merge pull request #288 from LalitDeore/memcache-fix
bug fix
2 parents 3dcb55b + cad15e2 commit e6772c0

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

shared.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)