1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
This commit is contained in:
sveisvei 2016-12-27 21:03:50 +01:00
parent 4f40d6c700
commit dfa490affb
12 changed files with 13 additions and 13 deletions

View File

@ -17,7 +17,7 @@ const { REQUEST_TIME } = require('./events');
module.exports = function (config) {
const app = express();
const baseUriPath = config.baseUriPath || '';
const baseUriPath = config.baseUriPath || '';
const publicFolder = config.publicFolder;
app.set('trust proxy');

View File

@ -152,7 +152,7 @@ test('should handle a lot of toggles', t => {
const toggleCounts = {};
for (let i = 0; i < 100; i++) {
toggleCounts[`toggle${i}`] = { yes: i, no: i };
toggleCounts[`toggle${i}`] = { yes: i, no: i };
}
store.emit('metrics', {

View File

@ -96,7 +96,7 @@ module.exports = class UnleashClientMetrics {
this.lastMinuteList.add(toggles, stop);
this.globalCount += count;
app.count += count;
app.count += count;
this.addSeenToggles(app, toggleNames);
}

View File

@ -75,7 +75,7 @@ module.exports = class List extends EventEmitter {
// whole list is removed
this.emit('evicted', cursor.value);
this.start = null;
this.tail = null;
this.tail = null;
// stop iteration
cursor = null;
} else if (result === true) {

View File

@ -1,6 +1,6 @@
'use strict';
const knex = require('knex');
const knex = require('knex');
module.exports.createDb = function ({ databaseUrl, poolMin = 2, poolMax = 20, databaseSchema = 'public' }) {
const db = knex({

View File

@ -12,4 +12,4 @@ function validateRequest (req) {
});
}
module.exports = validateRequest;
module.exports = validateRequest;

View File

@ -17,7 +17,7 @@ const strategyTypes = [
STRATEGY_UPDATED,
];
const featureTypes = [
const featureTypes = [
FEATURE_CREATED,
FEATURE_UPDATED,
FEATURE_ARCHIVED,
@ -61,7 +61,7 @@ function eachConsecutiveEvent (events, callback) {
let i;
let l;
for (i = 0, l = currentEvents.length; i < l; i++) {
left = currentEvents[i];
left = currentEvents[i];
right = currentEvents[i + 1];
callback(left, right);

View File

@ -5,7 +5,7 @@ const eventDiffer = require('./event-differ');
const { FEATURE_CREATED, FEATURE_UPDATED } = require('./event-type');
const logger = require('./logger');
test.beforeEach(() => {
test.beforeEach(() => {
logger.setLevel('FATAL');
});

View File

@ -1,5 +1,5 @@
'use strict';
module.exports = {
module.exports = {
REQUEST_TIME: 'request_time',
};

View File

@ -15,7 +15,7 @@ const DEFAULT_OPTIONS = {
module.exports = {
createOptions: (opts) => {
const options = Object.assign({}, DEFAULT_OPTIONS, opts);
const options = Object.assign({}, DEFAULT_OPTIONS, opts);
// If we are running in development we should assume local db
if (isDev() && !options.databaseUrl) {

View File

@ -65,7 +65,7 @@ module.exports = function (app, config) {
app.post('/features', (req, res) => {
req.checkBody('name', 'Name is required').notEmpty();
req.checkBody('name', 'Name must match format ^[0-9a-zA-Z\\.\\-]+$').matches(/^[0-9a-zA-Z\\.\\-]+$/i);
const userName = extractUser(req);
const userName = extractUser(req);
validateRequest(req)
.then(validateFormat)

View File

@ -147,7 +147,7 @@ module.exports = function (app, config) {
if (found) {
return found;
}
return { name, notFound: true };
return { name, notFound: true };
}),
instances,
seenToggles: seenToggles.map(name => {