Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am using a REST Connection and the token expires each hour, therefore I am using sub function to create a subrutine for the token table and after I use the call function to bring the subrutine, nevertheless the token doesn´t renew and 1 hour later I have the error in code because of expire time.
I appreciate if someone could help with this issue.
Below you will see the code
Use of sub function:
I use the Call Function:
Replace with your current expiry policy with below code and give a try
// Calculate absolute expiry time
LET vTokenExpiresAt = Now() + (Peek('expires_in', 0, 'root') / 86400);
// Force renewal 2 minutes before expiry
LET vRenewBefore = Timestamp(Now() + (2/1440)); // 2 minutes
IF $(vTokenExpiresAt) <= $(vRenewBefore) THEN
TRACE Token expired → refreshing again...
CALL ActualizarToken;
END IF;