Skip to content

Commit bc1949e

Browse files
committed
fix(api-request): send token request in advance when token would expire in up to 30min
1 parent d578f7b commit bc1949e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/methods/api-request.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ const apiRequest = client => {
159159
running[storeId] = delayFactor = 0
160160
if (auth.row && auth.row.expires) {
161161
const tokenTimestamp = new Date(auth.row.expires).getTime()
162-
if (tokenTimestamp <= Date.now() + 1000 * 60 * 10) {
162+
if (tokenTimestamp <= Date.now() + 1000 * 60 * 30) {
163163
// send token update request in advance
164164
askRefreshToken()
165165
if (tokenTimestamp <= Date.now() + 1000 * 5) {

0 commit comments

Comments
 (0)