Skip to content

Commit 92cd45a

Browse files
Switched to Expiring LRU cache for bandit actions
1 parent 1900fb8 commit 92cd45a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ export async function init(config: IClientConfig): Promise<EppoClient> {
125125
// we estimate this will use no more than 10 MB of memory
126126
// and should be appropriate for most server-side use cases.
127127
clientInstance.useLRUInMemoryAssignmentCache(50_000);
128-
clientInstance.useLRUInMemoryBanditAssignmentCache(50_000);
128+
// for bandits variant of LRU cache is use, that will
129+
// expire on its own after set time. Defaults to 10 minutes
130+
clientInstance.useExpiringInMemoryBanditAssignmentCache(50_000);
129131

130132
// Fetch configurations (which will also start regular polling per requestConfiguration)
131133
await clientInstance.fetchFlagConfigurations();

0 commit comments

Comments
 (0)