Skip to content

Commit 9f23dec

Browse files
authored
chore(gatsby): cache shouldn't reference nodes strongly (#34821)
* chore: cache shouldn't reference nodes strongly * Update lmdb-datastore.ts
1 parent f2d4830 commit 9f23dec

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/gatsby/src/datastore/lmdb/lmdb-datastore.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ function getDatabases(): ILmdbDatabases {
9393
// FIXME: sharedStructuresKey breaks tests - probably need some cleanup for it on DELETE_CACHE
9494
// sharedStructuresKey: Symbol.for(`structures`),
9595
// @ts-ignore
96-
cache: true,
96+
cache: {
97+
// expirer: false disables LRU part and only take care of WeakRefs
98+
// this way we don't retain nodes strongly, but will continue to
99+
// reuse them if they are loaded already
100+
expirer: false,
101+
},
97102
}),
98103
nodesByType: rootDb.openDB({
99104
name: `nodesByType`,

0 commit comments

Comments
 (0)