From a1e4f3e7fb67a401e0e19c345a8b4c3367a2ae40 Mon Sep 17 00:00:00 2001 From: Leonardo Matos Date: Mon, 8 Mar 2021 16:58:25 -0300 Subject: [PATCH] fix(update-tokens): minor fix debugging queue queue positions --- lib/services/update-tokens.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/services/update-tokens.js b/lib/services/update-tokens.js index 6e806dc..e2e1864 100644 --- a/lib/services/update-tokens.js +++ b/lib/services/update-tokens.js @@ -10,7 +10,10 @@ const updateTokens = client => { let queue = 0 const handleRefreshToken = row => { queue++ - const queuePosition = queue + if (debug) { + debug(`Refresh ${queue}° token for store #${row.store_id}`) + } + setTimeout(() => { // start app authentication flux const reqPromise = refreshToken(row.store_id, row.authentication_id) @@ -34,12 +37,11 @@ const updateTokens = client => { }) if (debug) { - debug(`Refresh ${queuePosition}° token for store #${row.store_id}`) reqPromise.then(() => { debug(`✓ Access token updated with success for store #${row.store_id}`) }) } - }, queuePosition * 1000) + }, queue * 1000) } const task = () => {