Skip to content

Commit

Permalink
set success cache to 30 days
Browse files Browse the repository at this point in the history
  • Loading branch information
lingdie committed Oct 11, 2023
1 parent f397d27 commit 6b624c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/admission/api/v1/icp.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ func (i *IcpValidator) Query(rule *netv1.IngressRule) (*IcpResponse, error) {

// genCacheTTL generates a cache TTL based on the response
func genCacheTTL(rsp *IcpResponse) time.Duration {
// If the response is valid, and the site license is not empty, cache for 24 hours
// If the response is valid, and the site license is not empty, cache for 30 days
if rsp.ErrorCode == 0 && rsp.Result.SiteLicense != "" {
return 24 * time.Hour
return 30 * 24 * time.Hour
}
// Otherwise, cache for 5 minutes
return 5 * time.Minute
Expand Down

0 comments on commit 6b624c1

Please sign in to comment.