mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-02-11 03:19:17 +00:00
store only id for number builds projection
This commit is contained in:
parent
c2db37b285
commit
ae860ad54e
6
db.js
6
db.js
@ -17,13 +17,13 @@ exports.init = function(dbPath, params, callback) {
|
|||||||
descCreateDate: descCreateDate,
|
descCreateDate: descCreateDate,
|
||||||
id: 1
|
id: 1
|
||||||
}},
|
}},
|
||||||
// note that's unordered projection (coz number is numeric)
|
// note that's unordered projection (coz number is numeric),
|
||||||
// TODO: pick only id as value for that rare used projection
|
// it also contains only id
|
||||||
{key: {
|
{key: {
|
||||||
projectName: pickProjectName,
|
projectName: pickProjectName,
|
||||||
number: 1,
|
number: 1,
|
||||||
id: 1
|
id: 1
|
||||||
}},
|
}, value: pickId},
|
||||||
{key: {
|
{key: {
|
||||||
projectName: pickProjectName,
|
projectName: pickProjectName,
|
||||||
status: 1,
|
status: 1,
|
||||||
|
@ -33,6 +33,7 @@ exports.init = function(params, callback) {
|
|||||||
exports._getPrevBuild = function(build, callback) {
|
exports._getPrevBuild = function(build, callback) {
|
||||||
Steppy(
|
Steppy(
|
||||||
function() {
|
function() {
|
||||||
|
// get id of prev build
|
||||||
db.builds.find({
|
db.builds.find({
|
||||||
start: {
|
start: {
|
||||||
projectName: build.project.name,
|
projectName: build.project.name,
|
||||||
@ -41,6 +42,10 @@ exports._getPrevBuild = function(build, callback) {
|
|||||||
limit: 1
|
limit: 1
|
||||||
}, this.slot());
|
}, this.slot());
|
||||||
},
|
},
|
||||||
|
function(err, builds) {
|
||||||
|
// get prev build by id
|
||||||
|
db.builds.find({start: {id: builds[0].id}}, this.slot());
|
||||||
|
},
|
||||||
function(err, builds) {
|
function(err, builds) {
|
||||||
this.pass(builds[0]);
|
this.pass(builds[0]);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user