Skip to content

Commit

Permalink
Added option to tell chokidar to use long polling to overcome an issu…
Browse files Browse the repository at this point in the history
…e with virtualbox not sending file system change events from the host machine.
  • Loading branch information
diogogmt committed Sep 22, 2015
1 parent 2c449c5 commit f6291b4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
38 changes: 20 additions & 18 deletions lib/forever-monitor/monitor.js
Expand Up @@ -43,24 +43,26 @@ var Monitor = exports.Monitor = function (script, options) {
//
// Setup basic configuration options
//
options = options || {};
this.silent = options.silent || false;
this.killTree = options.killTree !== false;
this.uid = options.uid || utile.randomString(4);
this.id = options.id || false;
this.pidFile = options.pidFile;
this.max = options.max;
this.killTTL = options.killTTL;
this.killSignal = options.killSignal || 'SIGKILL';
this.childExists = false;
this.checkFile = options.checkFile !== false;
this.times = 0;
this.warn = console.error;

this.logFile = options.logFile;
this.outFile = options.outFile;
this.errFile = options.errFile;
this.append = options.append;
options = options || {};
this.silent = options.silent || false;
this.killTree = options.killTree !== false;
this.uid = options.uid || utile.randomString(4);
this.id = options.id || false;
this.pidFile = options.pidFile;
this.max = options.max;
this.killTTL = options.killTTL;
this.killSignal = options.killSignal || 'SIGKILL';
this.childExists = false;
this.checkFile = options.checkFile !== false;
this.times = 0;
this.warn = console.error;

this.logFile = options.logFile;
this.outFile = options.outFile;
this.errFile = options.errFile;
this.append = options.append;
this.usePolling = options.usePolling;
this.pollingInterval = options.pollingInterval;

//
// Define some safety checks for commands with spaces
Expand Down
2 changes: 2 additions & 0 deletions lib/forever-monitor/plugins/watch.js
Expand Up @@ -63,6 +63,8 @@ exports.attach = function () {
});

var opts = {
usePolling: this.usePolling,
interval: this.pollingInterval,
ignoreInitial: true,
ignored: function(fileName) {
return !watchFilter.call(monitor, fileName);
Expand Down

0 comments on commit f6291b4

Please sign in to comment.