Skip to content

Commit 10e560d

Browse files
committed
Merge remote-tracking branch 'upstream/main'
# Conflicts: # package-lock.json # package.json
2 parents 949b065 + ca672bc commit 10e560d

File tree

3 files changed

+4162
-10378
lines changed

3 files changed

+4162
-10378
lines changed

libs/providers/flagd/src/lib/service/grpc/service.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@ import {
99
ParseError,
1010
ResolutionDetails,
1111
StandardResolutionReasons,
12-
TypeMismatchError,
12+
TypeMismatchError
1313
} from '@openfeature/js-sdk';
1414
import { GrpcTransport } from '@protobuf-ts/grpc-transport';
15-
import type { JsonValue as PbJsonValue } from '@protobuf-ts/runtime';
1615
import type { UnaryCall } from '@protobuf-ts/runtime-rpc';
1716
import { RpcError } from '@protobuf-ts/runtime-rpc';
18-
import LRU from 'lru-cache';
17+
import { LRUCache } from 'lru-cache';
1918
import { Struct } from '../../../proto/ts/google/protobuf/struct';
2019
import {
2120
EventStreamResponse,
@@ -28,7 +27,7 @@ import {
2827
ResolveObjectRequest,
2928
ResolveObjectResponse,
3029
ResolveStringRequest,
31-
ResolveStringResponse,
30+
ResolveStringResponse
3231
} from '../../../proto/ts/schema/v1/schema';
3332
import { ServiceClient } from '../../../proto/ts/schema/v1/schema.client';
3433
import { Config } from '../../configuration';
@@ -37,7 +36,7 @@ import {
3736
DEFAULT_MAX_CACHE_SIZE,
3837
DEFAULT_MAX_EVENT_STREAM_RETRIES,
3938
EVENT_CONFIGURATION_CHANGE,
40-
EVENT_PROVIDER_READY,
39+
EVENT_PROVIDER_READY
4140
} from '../../constants';
4241
import { FlagdProvider } from '../../flagd-provider';
4342
import { Service } from '../service';
@@ -75,7 +74,7 @@ export const Codes = {
7574

7675
export class GRPCService implements Service {
7776
private _client: ServiceClient;
78-
private _cache: LRU<string, ResolutionDetails<FlagValue>> | undefined;
77+
private _cache: LRUCache<string, ResolutionDetails<FlagValue>> | undefined;
7978
private _cacheEnabled = false;
8079
private _streamAlive = false;
8180
private _streamConnectAttempt = 0;
@@ -104,7 +103,7 @@ export class GRPCService implements Service {
104103
// for now, we only need streaming if the cache is enabled (will need to be pulled out once we support events)
105104
if (config.cache === 'lru') {
106105
this._cacheEnabled = true;
107-
this._cache = new LRU({ maxSize: config.maxCacheSize || DEFAULT_MAX_CACHE_SIZE, sizeCalculation: () => 1 });
106+
this._cache = new LRUCache({ maxSize: config.maxCacheSize || DEFAULT_MAX_CACHE_SIZE, sizeCalculation: () => 1 });
108107
this.streamConnection = this.connectStream();
109108
}
110109
}

0 commit comments

Comments
 (0)