From 79b400e2b47058478600ce291f3c4b51ec0243c5 Mon Sep 17 00:00:00 2001 From: Mahesh N Date: Fri, 8 Nov 2024 16:14:04 +0530 Subject: [PATCH] remove 15 sec --- pkg/utils/meta.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/utils/meta.go b/pkg/utils/meta.go index 0efc8af2..28f4579f 100644 --- a/pkg/utils/meta.go +++ b/pkg/utils/meta.go @@ -63,11 +63,11 @@ func SetCMPVars(apiClient, brokerClient *client.APIClient, cfg *client.Configura apiClient.TokenExpiry = cmpDetails.ValidTill apiClient.SetMetaFnAndVersion(nil, 0, func(ctx *context.Context, meta interface{}) { // Initialise token handler - // Token expiry unix time in seconds and substract 15secs - tokenExpiry := apiClient.TokenExpiry/1000 - 15 + // Token expiry unix time in seconds + tokenExpiry := apiClient.TokenExpiry / 1000 token := apiClient.CMPToken // Token is about to expire and get new - if tokenExpiry < time.Now().Unix() { + if tokenExpiry <= time.Now().Unix() { cmpDetails, err := brokerClient.GetCMPDetails(*ctx) if err != nil { log.Printf("[ERROR] Unable to fetch token for CMP client: %s", err)