From fa139312a0fff981f11182c17ba6979dccca1105 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Tue, 30 Jul 2013 18:29:33 -0700 Subject: [PATCH] feat(watcher): make the batching delay configurable --- lib/config.js | 1 + lib/file-list.js | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/config.js b/lib/config.js index 057b23311..74ddfc679 100644 --- a/lib/config.js +++ b/lib/config.js @@ -255,6 +255,7 @@ var Config = function() { this.logLevel = constant.LOG_INFO; this.colors = true; this.autoWatch = false; + this.autoWatchBatchDelay = 250; this.reporters = ['progress']; this.singleRun = false; this.browsers = []; diff --git a/lib/file-list.js b/lib/file-list.js index 1e17eba26..1d999459d 100644 --- a/lib/file-list.js +++ b/lib/file-list.js @@ -63,8 +63,7 @@ var byPath = function(a, b) { // TODO(vojta): ignore changes (add/change/remove) when in the middle of refresh // TODO(vojta): do not glob patterns that are watched (both on init and refresh) -var List = function(patterns, excludes, emitter, preprocess) { - var batchInterval = 250; +var List = function(patterns, excludes, emitter, preprocess, batchInterval) { var self = this; var pendingDeferred; var pendingTimeout; @@ -373,7 +372,8 @@ var List = function(patterns, excludes, emitter, preprocess) { return done(); }; }; -List.$inject = ['config.files', 'config.exclude', 'emitter', 'preprocess']; +List.$inject = ['config.files', 'config.exclude', 'emitter', 'preprocess', + 'config.autoWatchBatchDelay']; // PUBLIC exports.List = List;