mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Fix to fix to e5f73a3
This commit is contained in:
@@ -88,8 +88,13 @@ catalog.refreshOrWarn = function (options) {
|
||||
catalog.runAndRetryWithRefreshIfHelpful = function (attempt) {
|
||||
buildmessage.assertInJob();
|
||||
|
||||
var canRetry = ! (catalog.triedToRefreshRecently ||
|
||||
catalog.official.offline);
|
||||
|
||||
// Run `attempt` in a nested buildmessage context.
|
||||
var messages = buildmessage.capture(attempt);
|
||||
var messages = buildmessage.capture(function () {
|
||||
attempt(canRetry);
|
||||
});
|
||||
|
||||
// Did it work? Great.
|
||||
if (! messages.hasMessages()) {
|
||||
@@ -100,9 +105,7 @@ catalog.runAndRetryWithRefreshIfHelpful = function (attempt) {
|
||||
// related to that, or because we tried to refresh recently, or because we're
|
||||
// not allowed to refresh? Fail, merging the result of these errors into the
|
||||
// current job.
|
||||
if (! messages.hasMessageWithTag('refreshCouldHelp') ||
|
||||
catalog.triedToRefreshRecently ||
|
||||
catalog.official.offline) {
|
||||
if (! (messages.hasMessageWithTag('refreshCouldHelp') && canRetry)) {
|
||||
buildmessage.mergeMessagesIntoCurrentJob(messages);
|
||||
return;
|
||||
}
|
||||
@@ -131,7 +134,7 @@ catalog.runAndRetryWithRefreshIfHelpful = function (attempt) {
|
||||
}
|
||||
|
||||
// Try again, this time directly in the current buildmessage job.
|
||||
attempt();
|
||||
attempt(false); // canRetry = false
|
||||
};
|
||||
|
||||
// As a work-around for [] !== [], we use a function to check whether values are acceptable
|
||||
|
||||
@@ -396,11 +396,9 @@ _.extend(ProjectContext.prototype, {
|
||||
var anticipatedPrereleases = self._getAnticipatedPrereleases(
|
||||
depsAndConstraints.constraints, cachedVersions);
|
||||
|
||||
var isFirstAttempt = true;
|
||||
|
||||
// Nothing before this point looked in the official or project catalog!
|
||||
// However, the resolver does, so it gets run in the retry context.
|
||||
catalog.runAndRetryWithRefreshIfHelpful(function () {
|
||||
catalog.runAndRetryWithRefreshIfHelpful(function (canRetry) {
|
||||
buildmessage.enterJob("selecting package versions", function () {
|
||||
var resolver = self._buildResolver();
|
||||
|
||||
@@ -415,7 +413,7 @@ _.extend(ProjectContext.prototype, {
|
||||
// of it yet. It's not actually fatal, though, for previousSolution
|
||||
// to refer to package versions that we don't have access to or don't
|
||||
// exist. They'll end up getting changed or removed if possible.
|
||||
missingPreviousVersionIsError: isFirstAttempt
|
||||
missingPreviousVersionIsError: canRetry
|
||||
};
|
||||
if (self._upgradePackageNames)
|
||||
resolveOptions.upgrade = self._upgradePackageNames;
|
||||
@@ -448,8 +446,6 @@ _.extend(ProjectContext.prototype, {
|
||||
|
||||
self._completedStage = STAGE.RESOLVE_CONSTRAINTS;
|
||||
});
|
||||
|
||||
isFirstAttempt = false;
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user