Skip to content

Commit

Permalink
fix: do not let empty file on error
Browse files Browse the repository at this point in the history
  • Loading branch information
GrosSacASac committed Dec 11, 2021
1 parent fac24dc commit a11190f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/PersistentFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ class PersistentFile extends EventEmitter {

destroy() {
this._writeStream.destroy();
unlink(this.filepath, () => {});
const filepath = this.filepath;
setTimeout(function () {
unlink(filepath, () => {});
}, 1)
}
}

Expand Down

0 comments on commit a11190f

Please sign in to comment.