Skip to content

Commit

Permalink
fix: 🐛 do not close persistent store
Browse files Browse the repository at this point in the history
  • Loading branch information
touv committed Oct 29, 2021
1 parent ea6d4e5 commit 79641b1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/analytics/src/combine.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ function sha1(input, salt) {
*/
export default function combine(data, feed) {
const { ezs } = this;
const persistent = Boolean(this.getParam('persistent', false));
let whenReady = Promise.resolve(true);
if (this.isFirst()) {
debug('ezs')('[combine] with sub pipeline.');
const location = this.getParam('location');
const persistent = Boolean(this.getParam('persistent', false));
const primer = this.getParam('primer');
const input = ezs.createStream(ezs.objectMode());
const commands = ezs.createCommands({
Expand Down Expand Up @@ -111,7 +111,9 @@ export default function combine(data, feed) {
}
}
if (this.isLast()) {
this.store.close();
if (!persistent) {
this.store.close();
}
return feed.close();
}
return whenReady
Expand Down

0 comments on commit 79641b1

Please sign in to comment.