mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-26 21:06:16 +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,
|
var Steppy = require('twostep').Steppy,
|
||||||
_ = require('underscore'),
|
_ = require('underscore'),
|
||||||
nlevel = require('nlevel'),
|
nlevel = require('nlevel'),
|
||||||
path = require('path');
|
path = require('path'),
|
||||||
|
utils = require('./lib/utils');
|
||||||
|
|
||||||
|
|
||||||
exports.init = function(dbPath, params, callback) {
|
exports.init = function(dbPath, params, callback) {
|
||||||
@ -83,9 +84,17 @@ exports.init = function(dbPath, params, callback) {
|
|||||||
|
|
||||||
exports.logLines = new nlevel.DocsSection(buildLogsDb, 'logLines', {
|
exports.logLines = new nlevel.DocsSection(buildLogsDb, 'logLines', {
|
||||||
projections: [
|
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'),
|
db = require('./db'),
|
||||||
path = require('path'),
|
path = require('path'),
|
||||||
fs = require('fs'),
|
fs = require('fs'),
|
||||||
logger = require('./lib/logger')('distributor'),
|
logger = require('./lib/logger')('distributor');
|
||||||
utils = require('./lib/utils');
|
|
||||||
|
|
||||||
|
|
||||||
exports.init = function(app, callback) {
|
exports.init = function(app, callback) {
|
||||||
@ -143,7 +142,6 @@ exports.init = function(app, callback) {
|
|||||||
db.logLines.put({
|
db.logLines.put({
|
||||||
id: logLineId,
|
id: logLineId,
|
||||||
buildId: build.id,
|
buildId: build.id,
|
||||||
numberStr: utils.toNumberStr(logLineNumber),
|
|
||||||
number: logLineNumber,
|
number: logLineNumber,
|
||||||
text: data
|
text: data
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
|
Loading…
Reference in New Issue
Block a user