mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-25 17:36:18 +00:00
numberStr is key only
This commit is contained in:
parent
ee9d6f3fde
commit
5bd98c6719
17
db.js
17
db.js
@ -3,7 +3,8 @@
|
||||
var Steppy = require('twostep').Steppy,
|
||||
_ = require('underscore'),
|
||||
nlevel = require('nlevel'),
|
||||
path = require('path');
|
||||
path = require('path'),
|
||||
utils = require('./lib/utils');
|
||||
|
||||
|
||||
exports.init = function(dbPath, params, callback) {
|
||||
@ -83,9 +84,17 @@ exports.init = function(dbPath, params, callback) {
|
||||
|
||||
exports.logLines = new nlevel.DocsSection(buildLogsDb, 'logLines', {
|
||||
projections: [
|
||||
{key: {buildId: 1, numberStr: 1}, value: function(logLine) {
|
||||
return _(logLine).pick('number', 'text');
|
||||
}}
|
||||
{
|
||||
key: {
|
||||
buildId: 1,
|
||||
numberStr: function(logLine) {
|
||||
return utils.toNumberStr(logLine.number);
|
||||
}
|
||||
},
|
||||
value: function(logLine) {
|
||||
return _(logLine).pick('number', 'text');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
|
@ -9,8 +9,7 @@ var Steppy = require('twostep').Steppy,
|
||||
db = require('./db'),
|
||||
path = require('path'),
|
||||
fs = require('fs'),
|
||||
logger = require('./lib/logger')('distributor'),
|
||||
utils = require('./lib/utils');
|
||||
logger = require('./lib/logger')('distributor');
|
||||
|
||||
|
||||
exports.init = function(app, callback) {
|
||||
@ -143,7 +142,6 @@ exports.init = function(app, callback) {
|
||||
db.logLines.put({
|
||||
id: logLineId,
|
||||
buildId: build.id,
|
||||
numberStr: utils.toNumberStr(logLineNumber),
|
||||
number: logLineNumber,
|
||||
text: data
|
||||
}, function(err) {
|
||||
|
Loading…
Reference in New Issue
Block a user