Skip to content

Commit

Permalink
feat(watcher): make the batching delay configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtajina committed Jul 31, 2013
1 parent b598106 commit fa13931
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
6 changes: 3 additions & 3 deletions lib/file-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit fa13931

Please sign in to comment.