From 257c9fd18fd1f0b6218a43592de37c61c106e8c6 Mon Sep 17 00:00:00 2001 From: jakedaleweb Date: Tue, 17 Jan 2023 14:09:46 +1300 Subject: [PATCH] Fix multiple callback calls --- lib/writer.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/writer.js b/lib/writer.js index 130d328e..984b17c8 100644 --- a/lib/writer.js +++ b/lib/writer.js @@ -111,7 +111,7 @@ class ParquetWriter { * method twice on the same object or add any rows after the close() method has * been called */ - async close(callback) { + async close() { if (this.closed) { throw 'writer was closed'; } @@ -128,10 +128,6 @@ class ParquetWriter { await this.envelopeWriter.writeFooter(this.userMetadata); await this.envelopeWriter.close(); this.envelopeWriter = null; - - if (callback) { - callback(); - } } /** @@ -313,7 +309,7 @@ class ParquetTransformer extends stream.Transform { } _flush(callback) { - this.writer.close(callback) + this.writer.close() .then(d => callback(null, d), callback); }