Skip to content

Commit cad15e2

Browse files
committed
fix licensing issue
1 parent 85c01db commit cad15e2

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
@@ -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

0 commit comments

Comments
 (0)