diff --git a/lib/run.js b/lib/run.js index d93ad4f21b..c87ea2fbd4 100644 --- a/lib/run.js +++ b/lib/run.js @@ -12,6 +12,7 @@ var updater = require(path.join(__dirname, '..', 'lib', 'updater.js')); var bundler = require(path.join(__dirname, '..', 'lib', 'bundler.js')); var mongo_runner = require(path.join(__dirname, '..', 'lib', 'mongo_runner.js')); var mongoExitCodes = require(path.join(__dirname, '..', 'lib', 'mongo_exit_codes.js')); +var warehouse = require("./warehouse.js"); var _ = require('underscore'); var inFiber = require(path.join(__dirname, 'fiber-helpers.js')).inFiber; @@ -496,7 +497,7 @@ _.extend(DependencyWatcher.prototype, { // XXX this should move to main meteor command-line, probably? var start_update_checks = function () { - var update_check = function () { + var update_check = inFiber(function () { // 'inFiber' to ensure we don't delay launching the app var manifest; try { manifest = updater.getManifest(); @@ -508,7 +509,7 @@ var start_update_checks = function () { var latestRelease = manifest.releases.stable; if (!files.in_checkout() && manifest && - latestRelease !== releaseVersion) { + latestRelease !== warehouse.latestRelease()) { console.log("////////////////////////////////////////"); console.log("////////////////////////////////////////"); console.log(); @@ -517,9 +518,11 @@ var start_update_checks = function () { console.log(); console.log("////////////////////////////////////////"); console.log("////////////////////////////////////////"); + + warehouse.fetchLatestRelease(); } - }; - setInterval(inFiber(update_check), 12*60*60*1000); // twice a day + }); + setInterval(update_check, 12*60*60*1000); // twice a day update_check(); // and now. };