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:
parent
7f452d1366
commit
9e4e594969
@ -1,9 +1,11 @@
|
||||
'use strict';
|
||||
const eventDbCreator = require('./event');
|
||||
const clientInstancesDbCreator = require('./client-instances');
|
||||
const clientMetricsDbCreator = require('./client-metrics');
|
||||
const clientStrategiesDbCreator = require('./client-strategies');
|
||||
|
||||
module.exports = (db) => ({
|
||||
eventDb: eventDbCreator(db),
|
||||
clientInstancesDb: clientInstancesDbCreator(db),
|
||||
clientMetricsDb: clientMetricsDbCreator(db),
|
||||
clientStrategiesDb: clientStrategiesDbCreator(db),
|
||||
|
@ -13,12 +13,13 @@ function createApp (options) {
|
||||
const db = require('./lib/db/db-pool')(options.databaseUri);
|
||||
|
||||
// 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 = new EventStore(eventDb);
|
||||
const featureDb = require('./lib/db/feature')(db, eventStore);
|
||||
const strategyDb = require('./lib/db/strategy')(db, eventStore);
|
||||
const { clientInstancesDb, clientMetricsDb, clientStrategiesDb } = require('./lib/db')(db);
|
||||
|
||||
const config = {
|
||||
baseUriPath: options.baseUriPath,
|
||||
|
@ -6,12 +6,11 @@ const BPromise = require('bluebird');
|
||||
let request = require('supertest');
|
||||
const databaseUri = require('./database-config').getDatabaseUri();
|
||||
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 = new EventStore(eventDb);
|
||||
const featureDb = require('../../lib/db/feature')(knex, eventStore);
|
||||
const strategyDb = require('../../lib/db/strategy')(knex, eventStore);
|
||||
const { clientInstancesDb, clientStrategiesDb, clientMetricsDb } = require('../../lib/db')(knex);
|
||||
|
||||
|
||||
const app = require('../../app')({
|
||||
|
Loading…
Reference in New Issue
Block a user