Skip to content

Commit

Permalink
chore: rebrand cache to delta
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaanus committed Dec 16, 2024
1 parent fb6748c commit 6164b09
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { Logger } from '../../logger';

import type { FeatureConfigurationClient } from '../feature-toggle/types/feature-toggle-strategies-store-type';
import type {
RevisionCacheEntry,
RevisionDeltaEntry,
ClientFeatureToggleDelta,
} from './delta/client-feature-toggle-delta';

Expand All @@ -21,7 +21,7 @@ export class ClientFeatureToggleService {

private segmentReadModel: ISegmentReadModel;

private clientFeatureToggleCache: ClientFeatureToggleDelta | null = null;
private clientFeatureToggleDelta: ClientFeatureToggleDelta | null = null;

constructor(
{
Expand All @@ -33,7 +33,7 @@ export class ClientFeatureToggleService {
) {
this.logger = getLogger('services/client-feature-toggle-service.ts');
this.segmentReadModel = segmentReadModel;
this.clientFeatureToggleCache = clientFeatureToggleCache;
this.clientFeatureToggleDelta = clientFeatureToggleCache;
this.clientFeatureToggleStore = clientFeatureToggleStore;
}

Expand All @@ -44,9 +44,9 @@ export class ClientFeatureToggleService {
async getClientDelta(
revisionId: number | undefined,
query: IFeatureToggleQuery,
): Promise<RevisionCacheEntry | undefined> {
if (this.clientFeatureToggleCache !== null) {
return this.clientFeatureToggleCache.getDelta(revisionId, query);
): Promise<RevisionDeltaEntry | undefined> {
if (this.clientFeatureToggleDelta !== null) {
return this.clientFeatureToggleDelta.getDelta(revisionId, query);
} else {
throw new Error(
'Calling the partial updates but the cache is not initialized',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/routes/client-api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import FeatureController from '../../features/client-feature-toggles/client-feat
import MetricsController from '../../features/metrics/instance/metrics';
import RegisterController from '../../features/metrics/instance/register';
import type { IUnleashConfig, IUnleashServices } from '../../types';
import ClientFeatureToggleDeltaController from '../../features/client-feature-toggles/delta/client-feature-toggle-cache-controller';
import ClientFeatureToggleDeltaController from '../../features/client-feature-toggles/delta/client-feature-toggle-delta-controller';

export default class ClientApi extends Controller {
constructor(config: IUnleashConfig, services: IUnleashServices) {
Expand Down

0 comments on commit 6164b09

Please sign in to comment.