diff --git a/packages/indexer-common/src/sequential-timer.ts b/packages/indexer-common/src/sequential-timer.ts index 700595ab1..53b2d2cf8 100644 --- a/packages/indexer-common/src/sequential-timer.ts +++ b/packages/indexer-common/src/sequential-timer.ts @@ -52,18 +52,14 @@ export function sequentialTimerReduce( function work() { const workStarted = Date.now() const promiseOrT = reducer(acc, workStarted) - const workEnded = Date.now() const loopTime = workStarted - lastWorkStarted - const workTime = workEnded - workStarted - logger.debug( - `sequentialTimerReduce loop took ${loopTime}ms, work took ${workTime}ms caller(${caller})`, - ) + logger.debug(`sequentialTimerReduce loop took ${loopTime}ms caller(${caller})`) - if (workTime > milliseconds) { + if (loopTime > milliseconds) { logger.warn( 'sequentialTimerReduce work took longer than the sequential timer was configured for', { - workTime, + loopTime, milliseconds, }, ) @@ -124,18 +120,14 @@ export function sequentialTimerMap( function work() { const workStarted = Date.now() const promiseOrU = mapper(Date.now()) - const workEnded = Date.now() const loopTime = workStarted - lastWorkStarted - const workTime = workEnded - workStarted - logger.debug( - `sequentialTimerMap loop took ${loopTime}ms, work took ${workTime}ms caller(${caller})`, - ) + logger.debug(`sequentialTimerMap loop took ${loopTime}ms caller(${caller})`) - if (workTime > milliseconds) { + if (loopTime > milliseconds) { logger.warn( 'sequentialTimerMap work took longer than the sequential timer was configured for', { - workTime, + loopTime, milliseconds, }, )