Skip to content

Commit

Permalink
chore(gatsby): cache shouldn't reference nodes strongly (#34821)
Browse files Browse the repository at this point in the history
* chore: cache shouldn't reference nodes strongly

* Update lmdb-datastore.ts
  • Loading branch information
pieh committed Feb 16, 2022
1 parent f2d4830 commit 9f23dec
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/gatsby/src/datastore/lmdb/lmdb-datastore.ts
Expand Up @@ -93,7 +93,12 @@ function getDatabases(): ILmdbDatabases {
// FIXME: sharedStructuresKey breaks tests - probably need some cleanup for it on DELETE_CACHE
// sharedStructuresKey: Symbol.for(`structures`),
// @ts-ignore
cache: true,
cache: {
// expirer: false disables LRU part and only take care of WeakRefs
// this way we don't retain nodes strongly, but will continue to
// reuse them if they are loaded already
expirer: false,
},
}),
nodesByType: rootDb.openDB({
name: `nodesByType`,
Expand Down

0 comments on commit 9f23dec

Please sign in to comment.