Skip to content

Commit a1e4f3e

Browse files
committed
fix(update-tokens): minor fix debugging queue queue positions
1 parent 8ea78e0 commit a1e4f3e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/services/update-tokens.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ const updateTokens = client => {
1010
let queue = 0
1111
const handleRefreshToken = row => {
1212
queue++
13-
const queuePosition = queue
13+
if (debug) {
14+
debug(`Refresh ${queue}° token for store #${row.store_id}`)
15+
}
16+
1417
setTimeout(() => {
1518
// start app authentication flux
1619
const reqPromise = refreshToken(row.store_id, row.authentication_id)
@@ -34,12 +37,11 @@ const updateTokens = client => {
3437
})
3538

3639
if (debug) {
37-
debug(`Refresh ${queuePosition}° token for store #${row.store_id}`)
3840
reqPromise.then(() => {
3941
debug(`✓ Access token updated with success for store #${row.store_id}`)
4042
})
4143
}
42-
}, queuePosition * 1000)
44+
}, queue * 1000)
4345
}
4446

4547
const task = () => {

0 commit comments

Comments
 (0)