Skip to content

Commit

Permalink
fix: handle callback correctly in the readRecords compiler hook
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Apr 8, 2023
1 parent 3c0af27 commit 83d049a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/Compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -970,10 +970,13 @@ ${other}`);
readRecords(callback) {
if (this.hooks.readRecords.isUsed()) {
if (this.recordsInputPath) {
asyncLib.parallel([
cb => this.hooks.readRecords.callAsync(cb),
this._readRecords.bind(this)
]);
asyncLib.parallel(
[
cb => this.hooks.readRecords.callAsync(cb),
this._readRecords.bind(this)
],
err => callback(err)
);
} else {
this.records = {};
this.hooks.readRecords.callAsync(callback);
Expand Down

0 comments on commit 83d049a

Please sign in to comment.