Skip to content

Commit

Permalink
0 default
Browse files Browse the repository at this point in the history
  • Loading branch information
HDegroote committed Jun 18, 2024
1 parent 5b9b757 commit 2495c77
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ module.exports = class Autobase extends ReadyResource {
this.system = null
this.version = -1

this.maxCacheSize = handlers.maxCacheSize || null
this.maxCacheSize = handlers.maxCacheSize || 0 // 0 means the hyperbee default cache size will be used

const {
ackInterval = DEFAULT_ACK_INTERVAL,
Expand Down
4 changes: 2 additions & 2 deletions test/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -1589,11 +1589,11 @@ test('basic - maxCacheSize opt', async t => {
t.is(base.system.db.maxCacheSize, 10, 'maxCacheSize applied to sys db')
})

test('basic - maxCacheSize has null default', async t => {
test('basic - maxCacheSize has 0 default', async t => {
const [store] = await createStores(1, t)
const base = new Autobase(store.namespace('with-cache'))
await base.ready()
t.is(base.maxCacheSize, null, 'maxCacheSize default null')
t.is(base.maxCacheSize, 0, 'maxCacheSize default 0')
})

// todo: this test is hard, probably have to rely on ff to recover
Expand Down

0 comments on commit 2495c77

Please sign in to comment.