Skip to content

Commit

Permalink
fix: remove the watermarks (googleapis#1313)
Browse files Browse the repository at this point in the history
* remove the watermarks

Removing the watermarks allows data not to be stuck at the last transform so that data doesn’t get stuck due to the watermarks.

* fix: remove the watermarks
  • Loading branch information
danieljbruce authored Aug 17, 2023
1 parent a461c17 commit 0126a0e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@ Please use the format 'prezzy' or '${instance.name}/tables/prezzy'.`);
let userCanceled = false;
const userStream = new PassThrough({
objectMode: true,
readableHighWaterMark: 0,
transform(row, _encoding, callback) {
if (userCanceled) {
callback();
Expand Down
3 changes: 2 additions & 1 deletion test/readrows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ describe('Bigtable/ReadRows', () => {
});

// TODO: enable after https://github.com/googleapis/nodejs-bigtable/issues/1286 is fixed
it.skip('should be able to stop reading from the read stream when reading asynchronously', function (done) {
it('should be able to stop reading from the read stream when reading asynchronously', function (done) {
if (process.platform === 'win32') {
this.timeout(60000); // it runs much slower on Windows!
}
Expand Down Expand Up @@ -252,6 +252,7 @@ describe('Bigtable/ReadRows', () => {
// Transform stream
const transform = new Transform({
objectMode: true,
writableHighWaterMark: 0,
transform: (row, _encoding, callback) => {
setTimeout(() => {
callback(null, row);
Expand Down

0 comments on commit 0126a0e

Please sign in to comment.