Skip to content

Commit

Permalink
fix(memleak): maybe fix it
Browse files Browse the repository at this point in the history
see pouchdb/pouchdb#6502

Ultimately we should be able to fix this memleak by doing a serious
analysis of heap etc but last time I tried I failed at understanding
what was going on.

So for now let's try to fix "obvious" mistakes.
  • Loading branch information
vvo committed May 15, 2017
1 parent 672c14a commit 711b830
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const defaultOptions = {
include_docs: true, // eslint-disable-line camelcase
conflicts: false,
attachments: false,
return_docs: false,
};

let loopStart = Date.now();
Expand Down Expand Up @@ -167,6 +168,7 @@ function watch({ seq }) {
since: seq,
live: true,
limit: undefined,
return_docs: false,
});

const q = queue((change, done) => {
Expand Down Expand Up @@ -194,8 +196,10 @@ function watch({ seq }) {
process.exit(0); // eslint-disable-line no-process-exit
});
}

return null;
})
.then(() => done(null))
.then(done)
.catch(done);
}, 1);

Expand Down

0 comments on commit 711b830

Please sign in to comment.