do not queue already queued project by default

This commit is contained in:
oleg 2015-12-25 23:57:59 +03:00
parent 374b84adb2
commit 8c53e0e621
3 changed files with 6 additions and 5 deletions

View File

@ -67,7 +67,7 @@ module.exports = function(app) {
app.distributor.run({
projectName: projectName,
withScmChangesOnly: req.body.withScmChangesOnly,
skipQueued: req.body.skipQueued,
queueTwice: req.body.queueTwice,
initiator: {type: 'httpApi'}
});
} else {

View File

@ -115,7 +115,7 @@ Distributor.prototype._runNext = function(callback) {
id: build.id,
number: build.number,
project: {name: build.project.name}
},
}
});
}
});
@ -164,7 +164,7 @@ Distributor.prototype._onBuildComplete = function(build, callback) {
id: build.id,
number: build.number,
project: {name: build.project.name}
},
}
}, triggerAfterGroup.slot());
}
});
@ -292,7 +292,7 @@ Distributor.prototype.run = function(params, callback) {
return callback();
}
if (params.skipQueued) {
if (!params.queueTwice) {
var queuedItem = _(self.queue).find(function(item) {
return item.project.name === project.name;
});

View File

@ -119,7 +119,8 @@ module.exports = function(app) {
logger.log('Run the project: "%s"', projectName);
distributor.run({
projectName: projectName,
initiator: {type: 'user'}
initiator: {type: 'user'},
queueTwice: true
});
res.send();
});