chore: count seconds once

Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
Johan Haals
2022-12-13 10:40:59 +01:00
parent fc52930f3e
commit 434b4ced60
@@ -329,10 +329,9 @@ function progressTracker() {
logger.debug(`Processing ${item.entityRef}`);
if (item.nextUpdateAt) {
promProcessingQueueDelay.observe(
-item.nextUpdateAt.diffNow().as('seconds'),
);
processingQueueDelay.record(-item.nextUpdateAt.diffNow().as('seconds'));
const seconds = -item.nextUpdateAt.diffNow().as('seconds');
promProcessingQueueDelay.observe(seconds);
processingQueueDelay.record(seconds);
}
function endTime() {