From aa91cc4e6b25af942d5cd9414312ef3ddbf108f2 Mon Sep 17 00:00:00 2001 From: David Greenspan Date: Mon, 29 Sep 2014 15:40:09 -0700 Subject: [PATCH] Reduce progress bar polling (and make a constant) --- tools/console.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/console.js b/tools/console.js index 0c09ff08b1..6509ec23dd 100644 --- a/tools/console.js +++ b/tools/console.js @@ -69,6 +69,7 @@ PROGRESS_BAR_FORMAT = '[:bar] :percent :etas'; STATUS_POSITION = PROGRESS_BAR_WIDTH + 15; STATUS_MAX_LENGTH = 40; +STATUS_INTERVAL_MS = 500; // Message to show when we don't know what we're doing // XXX: ? FALLBACK_STATUS = 'Pondering'; @@ -156,7 +157,7 @@ _.extend(Console.prototype, { var self = this; var now = Date.now(); - if ((now - self._lastStatusPoll) < 50) { + if ((now - self._lastStatusPoll) < STATUS_INTERVAL_MS) { return; } self._statusPoll(); @@ -166,7 +167,7 @@ _.extend(Console.prototype, { var self = this; Fiber(function () { while (true) { - sleep(50); + sleep(STATUS_INTERVAL_MS); self._statusPoll(); }