Skip to content
Myr

Renamed setting to "reload views"

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent e2570be · Browse files · 3 files+11 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+11 added−8 removed

  • other:+11 added−8 removed

3 files+11 added−8 removed

modified:examples/jade/app.js+3 added-2 removed
modified:lib/express/server.js+2 added-2 removed
68 unmodified lines
69 this.set('env', process.env.EXPRESS_ENV || process.connectEnv.name);70 this.runConfig('any', this.set('env'));7172 // Setup view reloading73 if (this.set('view reloading')) {74 view.watcher.call(this, this.set('view reloading'));73 if (this.set('reload views')) {74 view.watcher.call(this, this.set('reload views'));75 }76 77 connect.Server.prototype.listen.call(this, port);78};
87 unmodified lines
modified:lib/express/view.js+6 added-4 removed
70 unmodified lines
71/**72 * Setup view reloading, checking at the given `interval`73 * which defaults to 5 minutes.74 *75 * @param {Object} options75 * @param {Numbers} interval76 * @api private77 */7879exports.watcher = function(options){80 options = options || { interval: 300000 };79exports.watcher = function(interval){80 interval = interval === true81 ? 30000082 : interval;83 (function cache(dir){84 fs.readdir(dir, function(err, files){85 if (!err) {86 files.forEach(function(file){87 file = dir + '/' + file;88 fs.stat(file, function(err, stats){89 if (!err) {90 if (stats.isFile()) {89 fs.watchFile(file, options, function(curr, prev){91 fs.watchFile(file, { interval: interval }, function(curr, prev){92 if (curr.mtime > prev.mtime) {93 cacheView(file);94 }95 });
167 unmodified lines