mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Don't run the npm downloads in parallel
Seems to break. We should fix this properly in future, for a better dev UX
This commit is contained in:
@@ -505,42 +505,62 @@ var forkJoin = function (options, iterable, fn) {
|
||||
var messageSet = currentMessageSet.get();
|
||||
var progress = currentProgress.get();
|
||||
|
||||
_.each(iterable, function (/*arguments*/) {
|
||||
var fut = new Future();
|
||||
var fnArguments = arguments;
|
||||
Fiber(function () {
|
||||
currentProgress.withValue(progress, function () {
|
||||
currentMessageSet.withValue(messageSet, function () {
|
||||
currentJob.withValue(job, function () {
|
||||
try {
|
||||
var result = enterJob({title: (options.title || '') + ' child' }, function () {
|
||||
return fn.apply(null, fnArguments);
|
||||
});
|
||||
fut['return'](result);
|
||||
} catch (e) {
|
||||
fut['throw'](e);
|
||||
}
|
||||
var parallel = (options.parallel !== undefined) ? options.parallel : true;
|
||||
if (parallel) {
|
||||
_.each(iterable, function (/*arguments*/) {
|
||||
var fut = new Future();
|
||||
var fnArguments = arguments;
|
||||
Fiber(function () {
|
||||
currentProgress.withValue(progress, function () {
|
||||
currentMessageSet.withValue(messageSet, function () {
|
||||
currentJob.withValue(job, function () {
|
||||
try {
|
||||
var result = enterJob({title: (options.title || '') + ' child' }, function () {
|
||||
return fn.apply(null, fnArguments);
|
||||
});
|
||||
fut['return'](result);
|
||||
} catch (e) {
|
||||
fut['throw'](e);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}).run();
|
||||
futures.push(fut);
|
||||
});
|
||||
}).run();
|
||||
futures.push(fut);
|
||||
});
|
||||
|
||||
_.each(futures, function (future) {
|
||||
try {
|
||||
var result = future.wait();
|
||||
results.push(result);
|
||||
errors.push(null);
|
||||
} catch (e) {
|
||||
results.push(null);
|
||||
errors.push(e);
|
||||
_.each(futures, function (future) {
|
||||
try {
|
||||
var result = future.wait();
|
||||
results.push(result);
|
||||
errors.push(null);
|
||||
} catch (e) {
|
||||
results.push(null);
|
||||
errors.push(e);
|
||||
|
||||
if (firstError === null) {
|
||||
firstError = e;
|
||||
if (firstError === null) {
|
||||
firstError = e;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// not parallel
|
||||
_.each(iterable, function (/*arguments*/) {
|
||||
var fnArguments = arguments;
|
||||
try {
|
||||
var result = fn.apply(null, fnArguments);
|
||||
results.push(result);
|
||||
errors.push(null);
|
||||
} catch (e) {
|
||||
results.push(null);
|
||||
errors.push(e);
|
||||
|
||||
if (firstError === null) {
|
||||
firstError = e;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (firstError) {
|
||||
|
||||
@@ -456,7 +456,8 @@ _.extend(LocalCatalog.prototype, {
|
||||
};
|
||||
|
||||
// Load the package sources for packages and their tests into packageSources.
|
||||
buildmessage.forkJoin({ 'title': 'Initializing packages'}, self.effectiveLocalPackages, function (x) {
|
||||
// XXX: We should make this work with parallel: true; right now it seems to hit node problems
|
||||
buildmessage.forkJoin({ 'title': 'Initializing packages', parallel: false }, self.effectiveLocalPackages, function (x) {
|
||||
initSourceFromDir(x);
|
||||
});
|
||||
|
||||
|
||||
@@ -311,7 +311,7 @@ _.extend(exports.Tropohouse.prototype, {
|
||||
options = options || {};
|
||||
var serverArch = options.serverArch || archinfo.host();
|
||||
var downloadedPackages = {};
|
||||
buildmessage.forkJoin({ title: 'Downloading packages'},
|
||||
buildmessage.forkJoin({ title: 'Downloading packages', parallel: true },
|
||||
versionMap, function (version, name) {
|
||||
try {
|
||||
self.maybeDownloadPackageForArchitectures({
|
||||
|
||||
Reference in New Issue
Block a user