Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix problem (b) from previous commit.

However, I think this is a dead end because we can't address (a) this way. I'll
try a different direction in another branch.
  • Loading branch information...
commit 0d3e73e7ce567a25bd2d65bd92aa488d36d720af 1 parent d2b8d8a
@glasser glasser authored
Showing with 14 additions and 9 deletions.
  1. +14 −9 tools/run.js
View
23 tools/run.js
@@ -632,15 +632,20 @@ exports.run = function (context, options) {
relativeFiles = [options.settingsFile];
}
- watcher = new DependencyWatcher(deps_info, context.appDir, relativeFiles,
- context.packageSearchOptions, mtimes,
- function (previousMtimes) {
- mtimes = previousMtimes;
- if (Status.crashing)
- log_to_clients({'system': "=> Modified -- restarting."});
- Status.reset();
- restart_server();
- });
+ watcher = new DependencyWatcher(
+ deps_info, context.appDir, relativeFiles,
+ context.packageSearchOptions, mtimes,
+ function (previousMtimes) {
+ // Defer so restarts never happen synchronously before the server is
+ // even started.
+ _.defer(function () {
+ mtimes = previousMtimes;
+ if (Status.crashing)
+ log_to_clients({'system': "=> Modified -- restarting."});
+ Status.reset();
+ restart_server();
+ });
+ });
}
};
Please sign in to comment.
Something went wrong with that request. Please try again.