1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-09 00:18:00 +01:00
This commit is contained in:
sveisvei 2016-12-27 21:03:50 +01:00 committed by Ivar Conradi Østhus
parent 303531d489
commit 1d3faca238
12 changed files with 13 additions and 13 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
const knex = require('knex'); const knex = require('knex');
module.exports.createDb = function ({ databaseUrl, poolMin = 2, poolMax = 20, databaseSchema = 'public' }) { module.exports.createDb = function ({ databaseUrl, poolMin = 2, poolMax = 20, databaseSchema = 'public' }) {
const db = knex({ 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, STRATEGY_UPDATED,
]; ];
const featureTypes = [ const featureTypes = [
FEATURE_CREATED, FEATURE_CREATED,
FEATURE_UPDATED, FEATURE_UPDATED,
FEATURE_ARCHIVED, FEATURE_ARCHIVED,
@ -61,7 +61,7 @@ function eachConsecutiveEvent (events, callback) {
let i; let i;
let l; let l;
for (i = 0, l = currentEvents.length; i < l; i++) { for (i = 0, l = currentEvents.length; i < l; i++) {
left = currentEvents[i]; left = currentEvents[i];
right = currentEvents[i + 1]; right = currentEvents[i + 1];
callback(left, right); callback(left, right);

View File

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

View File

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

View File

@ -15,7 +15,7 @@ const DEFAULT_OPTIONS = {
module.exports = { module.exports = {
createOptions: (opts) => { 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 we are running in development we should assume local db
if (isDev() && !options.databaseUrl) { if (isDev() && !options.databaseUrl) {

View File

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

View File

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