Skip to content

Commit 22a6720

Browse files
authored
fix: avoid crashing when auto-compression fails (#286)
1 parent d5f4597 commit 22a6720

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lib/db.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,9 @@ export class JsonlDB<V extends unknown = unknown> {
705705
) {
706706
// Need to compress
707707
task = { type: "compress", done: createDeferredPromise() };
708+
// but catch errors!
709+
// eslint-disable-next-line @typescript-eslint/no-empty-function
710+
task.done.catch(() => {});
708711
} else {
709712
// Take the first tasks of from the task queue
710713
task = this._persistenceTasks.shift() ?? { type: "none" };

0 commit comments

Comments
 (0)