Skip to content

Commit

Permalink
remove 15 sec
Browse files Browse the repository at this point in the history
  • Loading branch information
mahesh-hpe committed Nov 8, 2024
1 parent c9ca794 commit 79b400e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/utils/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 79b400e

Please sign in to comment.