Skip to content

Commit 48846ad

Browse files
committed
Fix cache size calculation.
1 parent 27c7577 commit 48846ad

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/module-mongodb-storage/src/storage/implementation/MongoSyncBucketStorage.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,9 @@ export class MongoSyncBucketStorage
947947
max: 50,
948948
maxSize: 10 * 1024 * 1024,
949949
sizeCalculation: (value: CheckpointChanges) => {
950-
return 100 + [...value.updatedParameterLookups].reduce<number>((a, b) => a + b.length, 0);
950+
const paramSize = [...value.updatedParameterLookups].reduce<number>((a, b) => a + b.length, 0);
951+
const bucketSize = [...value.updatedDataBuckets].reduce<number>((a, b) => a + b.length, 0);
952+
return 100 + paramSize + bucketSize;
951953
},
952954
fetchMethod: async (_key, _staleValue, options) => {
953955
return this.getCheckpointChangesInternal(options.context.options);

0 commit comments

Comments
 (0)