Skip to content

Commit 488226f

Browse files
committed
persist storage: fix running *without* archive
1 parent a8b12f8 commit 488226f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/packages/conat/persist/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ class PersistStreamClient extends EventEmitter {
108108
new ConatError(headers?.error, { code: headers?.code }),
109109
);
110110
this.close();
111+
return;
111112
}
112113
if (this.gettingMissed) {
113114
this.changesWhenGettingMissed.push(updates);

src/packages/conat/persist/storage.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ export class PersistentStream extends EventEmitter {
266266

267267
private initArchive = () => {
268268
if (!this.options.archive) {
269+
this.throttledBackup = () => {};
269270
return;
270271
}
271272
this.throttledBackup = throttle(
@@ -337,7 +338,7 @@ export class PersistentStream extends EventEmitter {
337338
// reuseInFlight since probably doing a backup on top
338339
// of itself would corrupt data.
339340
if (!this.options.archive) {
340-
throw Error("no backup target file set");
341+
return;
341342
}
342343
const path = this.options.archive + ".db";
343344
try {

0 commit comments

Comments
 (0)