1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

Minor cleanup: eventDb inside db

This commit is contained in:
ivaosthu 2016-11-04 09:23:46 +01:00 committed by Ivar Conradi Østhus
parent 7f452d1366
commit 9e4e594969
3 changed files with 6 additions and 4 deletions

View File

@ -1,9 +1,11 @@
'use strict'; 'use strict';
const eventDbCreator = require('./event');
const clientInstancesDbCreator = require('./client-instances'); const clientInstancesDbCreator = require('./client-instances');
const clientMetricsDbCreator = require('./client-metrics'); const clientMetricsDbCreator = require('./client-metrics');
const clientStrategiesDbCreator = require('./client-strategies'); const clientStrategiesDbCreator = require('./client-strategies');
module.exports = (db) => ({ module.exports = (db) => ({
eventDb: eventDbCreator(db),
clientInstancesDb: clientInstancesDbCreator(db), clientInstancesDb: clientInstancesDbCreator(db),
clientMetricsDb: clientMetricsDbCreator(db), clientMetricsDb: clientMetricsDbCreator(db),
clientStrategiesDb: clientStrategiesDbCreator(db), clientStrategiesDb: clientStrategiesDbCreator(db),

View File

@ -13,12 +13,13 @@ function createApp (options) {
const db = require('./lib/db/db-pool')(options.databaseUri); const db = require('./lib/db/db-pool')(options.databaseUri);
// Database dependecies (statefull) // Database dependecies (statefull)
const eventDb = require('./lib/db/event')(db); const { eventDb, clientInstancesDb, clientMetricsDb, clientStrategiesDb } = require('./lib/db')(db);
// Needs some cleanup!
const EventStore = require('./lib/event-store'); const EventStore = require('./lib/event-store');
const eventStore = new EventStore(eventDb); const eventStore = new EventStore(eventDb);
const featureDb = require('./lib/db/feature')(db, eventStore); const featureDb = require('./lib/db/feature')(db, eventStore);
const strategyDb = require('./lib/db/strategy')(db, eventStore); const strategyDb = require('./lib/db/strategy')(db, eventStore);
const { clientInstancesDb, clientMetricsDb, clientStrategiesDb } = require('./lib/db')(db);
const config = { const config = {
baseUriPath: options.baseUriPath, baseUriPath: options.baseUriPath,

View File

@ -6,12 +6,11 @@ const BPromise = require('bluebird');
let request = require('supertest'); let request = require('supertest');
const databaseUri = require('./database-config').getDatabaseUri(); const databaseUri = require('./database-config').getDatabaseUri();
const knex = require('../../lib/db/db-pool')(databaseUri); const knex = require('../../lib/db/db-pool')(databaseUri);
const eventDb = require('../../lib/db/event')(knex); const { eventDb, clientInstancesDb, clientStrategiesDb, clientMetricsDb } = require('../../lib/db')(knex);
const EventStore = require('../../lib/event-store'); const EventStore = require('../../lib/event-store');
const eventStore = new EventStore(eventDb); const eventStore = new EventStore(eventDb);
const featureDb = require('../../lib/db/feature')(knex, eventStore); const featureDb = require('../../lib/db/feature')(knex, eventStore);
const strategyDb = require('../../lib/db/strategy')(knex, eventStore); const strategyDb = require('../../lib/db/strategy')(knex, eventStore);
const { clientInstancesDb, clientStrategiesDb, clientMetricsDb } = require('../../lib/db')(knex);
const app = require('../../app')({ const app = require('../../app')({