Skip to content

Commit 15a484d

Browse files
committed
default
1 parent 7ab7c69 commit 15a484d

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

lib/client_factory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { extractEventProcessor } from "./event_processor/event_processor_factory
2525
import { extractOdpManager } from "./odp/odp_manager_factory";
2626
import { extractVuidManager } from "./vuid/vuid_manager_factory";
2727
import{ RequestHandler } from "./utils/http_request_handler/http";
28-
import { CLIENT_VERSION, JAVASCRIPT_CLIENT_ENGINE } from "./utils/enums";
28+
import { CLIENT_VERSION, DEFAULT_CMAB_CACHE_SIZE, DEFAULT_CMAB_CACHE_TIMEOUT, JAVASCRIPT_CLIENT_ENGINE } from "./utils/enums";
2929
import Optimizely from "./optimizely";
3030
import { DefaultCmabClient } from "./core/decision_service/cmab/cmab_client";
3131
import { NodeRequestHandler } from "./utils/http_request_handler/request_handler.node";
@@ -68,7 +68,7 @@ export const getOptimizelyInstance = (config: OptimizelyFactoryConfig): Client |
6868

6969
const cmabService = new DefaultCmabService({
7070
cmabClient,
71-
cmabCache: new InMemoryLruCache<CmabCacheValue>(10000),
71+
cmabCache: new InMemoryLruCache<CmabCacheValue>(DEFAULT_CMAB_CACHE_SIZE, DEFAULT_CMAB_CACHE_TIMEOUT),
7272
});
7373

7474
const optimizelyOptions = {

lib/utils/enums/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,5 @@ export { NOTIFICATION_TYPES } from '../../notification_center/type';
111111
*/
112112
export const REQUEST_TIMEOUT_MS = 60 * 1000; // 1 minute
113113

114-
115-
114+
export const DEFAULT_CMAB_CACHE_TIMEOUT = 30 * 60 * 1000; // 30 minutes
115+
export const DEFAULT_CMAB_CACHE_SIZE = 1000;

lib/utils/promise/operation_value.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ const isPromise = (val: any): boolean => {
77
return val && typeof val.then === 'function';
88
}
99

10-
export const opValue = <OP extends OpType, V>(op: OP, val: V | Promise<V>): OpValue<OP, V> => {
11-
return Value.of(op, val).get();
12-
}
13-
1410
/**
1511
* A class to wraps a value that can be either a synchronous value or a promise and provides
1612
* a promise like API. This class is used to handle both synchronous and asynchronous values

0 commit comments

Comments
 (0)