Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #45 from fengmk2/skip-download-error
Browse files Browse the repository at this point in the history
skip error version. fixed #43
  • Loading branch information
dead-horse committed Dec 10, 2013
2 parents ce9df54 + 30df2f1 commit a995cd6
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions controllers/registry/sync_module_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,21 @@ SyncModuleWorker.prototype._sync = function (pkg, callback) {

var versionNames = [];
ep.on('syncModule', function (syncModule) {
versionNames.push(syncModule.version);
that._syncOneVersion(versionNames.length, syncModule, ep.done(function (result) {
var index = versionNames.length;
that._syncOneVersion(index, syncModule, function (err, result) {
if (err) {
that.log(' [%s:%d] error, version: %s, %s: %s',
syncModule.name, index, syncModule.version, err.name, err.message);
} else {
versionNames.push(syncModule.version);
}

var nextVersion = missingVersions.shift();
if (!nextVersion) {
return ep.emit('syncDone', result);
}
ep.emit('syncModule', nextVersion);
}));
});
});

ep.on('syncDone', function () {
Expand Down Expand Up @@ -287,7 +294,7 @@ SyncModuleWorker.prototype._syncOneVersion = function (versionIndex, sourcePacka
ep.on('uploadResult', function (result) {
// remove tmp file whatever
fs.unlink(filepath, utility.noop);

//make sure sync module have the correct author info
//only if can not get maintainers, use the username
var author = username;
Expand Down

0 comments on commit a995cd6

Please sign in to comment.