1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-20 00:08:02 +01:00

fix: revert composition root (#6492)

This commit is contained in:
Mateusz Kwasniewski 2024-03-11 13:09:13 +01:00 committed by GitHub
parent 0cf7b324a5
commit c841e72244
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -111,10 +111,9 @@ import {
import { InactiveUsersService } from '../users/inactive/inactive-users-service'; import { InactiveUsersService } from '../users/inactive/inactive-users-service';
import { SegmentReadModel } from '../features/segment/segment-read-model'; import { SegmentReadModel } from '../features/segment/segment-read-model';
import { FakeSegmentReadModel } from '../features/segment/fake-segment-read-model'; import { FakeSegmentReadModel } from '../features/segment/fake-segment-read-model';
import { import ClientFeatureToggleReadModel from '../proxy/client-feature-toggle-read-model';
createFakeProxyService, import FakeClientFeatureToggleReadModel from '../proxy/fake-client-feature-toggle-read-model';
createProxyService, import { GlobalFrontendApiCache } from '../proxy/global-frontend-api-cache';
} from '../proxy/createProxyService';
export const createServices = ( export const createServices = (
stores: IUnleashStores, stores: IUnleashStores,
@ -297,9 +296,27 @@ export const createServices = (
? createClientFeatureToggleService(db, config) ? createClientFeatureToggleService(db, config)
: createFakeClientFeatureToggleService(config); : createFakeClientFeatureToggleService(config);
const proxyService = db const clientFeatureToggleReadModel = db
? createProxyService(db, config, clientMetricsServiceV2) ? new ClientFeatureToggleReadModel(db, config.eventBus)
: createFakeProxyService(config, clientMetricsServiceV2); : new FakeClientFeatureToggleReadModel();
const globalFrontendApiCache = new GlobalFrontendApiCache(
config,
segmentReadModel,
clientFeatureToggleReadModel,
configurationRevisionService,
);
const proxyService = new ProxyService(
config,
stores,
{
featureToggleServiceV2,
clientMetricsServiceV2,
settingService,
configurationRevisionService,
},
globalFrontendApiCache,
);
const edgeService = new EdgeService({ apiTokenService }, config); const edgeService = new EdgeService({ apiTokenService }, config);