Running a Python script to update 2,000 users. The initial access token works fine for the first 500 requests. Then it hits a 401 Unauthorized error mid-batch. My refresh logic checks the expiry timestamp, but the token seems to die before the calculated expiry.
requests.post(url, headers={'Authorization': f'Bearer {token}'})
# Response: 401 Unauthorized
The refresh endpoint returns a new token, but subsequent calls still fail. Am I handling the clock skew wrong?