Hello guys,
It seems that there is a weird issue with the date or the timeinterval on the latest xojo.
I am calling an API and in order not to check like crazy i get the TTL of the token , which in my case for test purposes i set it at 12 hours .
“expires_in”: 43199
Until here all good.
i add that to a DateTime variable and i store it in the DB .
Var dif As New DateInterval
AD.TokenTTL = loginJS.Value("expires_in").IntegerValue
dif.Seconds = AD.TokenTTL
AD.tokenExpDate = tokenTS + dif
So here i have the “Proper” Expiry timestamp.
In the main window i run a timer every 5 min to check the expiry date against the current date
Var curDte As DateTime
Var Interval As DateInterval
curDte = DateTime.Now
Interval = AD.tokenExpDate - curDte
If Interval.Minutes < 10 Then
'Fetch the new token
End If
Apparently after 6 hours, or always half the time i set in the expiry token it fires and fetches new token.
After it fires the first time, in my case in 6 hours not 12, then it seems that the time gets reduced to 1 hour and it fires every 50 min to fetch the new token .
The API guy says that he set the expiry date to 720 min , so 12 hours supposedly and it should provide a 12 hours token validity TTL in my case.
So considering that i do get the first token as 12 hours , stated above
“expires_in”: 43199
The question is , why the API call from XOJO based on my code fires at 6 Hours ? for the first time ?
Is this a bug or i do something wrong ?
IDE : XOJO 2022R4.1
OS : MacOS Monterey, 12.6.2
Hardware : MacMini, M1 Chip.
App compiled for M1, and it runs as build app and not as debug.
Thanks.