Skip to content

Commit

Permalink
fix: enable in-memory cache when in multi-tenant mode
Browse files Browse the repository at this point in the history
Signed-off-by: Akiff Manji <[email protected]>
  • Loading branch information
amanji committed Jun 26, 2024
1 parent ee41acc commit 0cb947d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/rest/src/utils/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import {
KeyDidResolver,
JwkDidResolver,
PeerDidResolver,
CacheModule,
InMemoryLruCache,
} from '@credo-ts/core'
import {
IndyVdrAnonCredsRegistry,
Expand Down Expand Up @@ -151,12 +153,17 @@ export function getAgentModules(options: {
tenants?: TenantsModule<typeof baseModules>
indyVdr?: IndyVdrModule
cheqd?: CheqdModule
cache?: CacheModule
} = baseModules

if (options.multiTenant) {
modules.tenants = new TenantsModule({
sessionLimit: Infinity,
})
// Disable SingleContextStorageLruCache
modules.cache = new CacheModule({
cache: new InMemoryLruCache({ limit: 100 }),
})
}

// Register indy module and related resolvers/registrars
Expand Down

0 comments on commit 0cb947d

Please sign in to comment.