Skip to content

Commit 07c6be7

Browse files
committed
wip
1 parent ee7669a commit 07c6be7

File tree

1 file changed

+4
-4
lines changed
  • packages/signals/signals/src/core/buffer

1 file changed

+4
-4
lines changed

packages/signals/signals/src/core/buffer/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class SignalStore implements SignalPersistentStorage {
2525
}
2626

2727
constructor(settings: { maxBufferSize?: number } = {}) {
28-
this.maxBufferSize = settings.maxBufferSize ?? 50
28+
this.maxBufferSize = settings.maxBufferSize ?? 10
2929
this.db = this.initSignalDB()
3030
}
3131

@@ -59,20 +59,20 @@ export class SignalStore implements SignalPersistentStorage {
5959
const transaction = db.transaction(SignalStore.STORE_NAME, 'readwrite')
6060
const store = transaction.objectStore(SignalStore.STORE_NAME)
6161
let count = await store.count()
62-
if (count >= maxItems) {
62+
if (count > maxItems) {
6363
const cursor = await store.openCursor()
6464
if (cursor) {
6565
// delete up to maxItems
6666
if (deleteMultiple) {
67-
while (count >= maxItems) {
67+
while (count > maxItems) {
6868
await cursor.delete()
6969
count--
7070
await cursor.continue()
7171
}
7272
} else {
7373
await cursor.delete()
7474
}
75-
logger.debug('Deleted item', { count: count - 1, key: cursor.key })
75+
logger.debug('Deleted item', { count: count, key: cursor.key })
7676
}
7777
}
7878
return await transaction.done

0 commit comments

Comments
 (0)