Skip to content

Commit

Permalink
fix: no longer hangs application due to the request cache (#821)
Browse files Browse the repository at this point in the history
* use weak timeout (rather than strong timeout)

* remove process.exit, as it is no longer necessary
  • Loading branch information
AJ ONeal committed Dec 13, 2020
1 parent 15d24f1 commit e7ad270
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions example/ffmpeg.js
Expand Up @@ -82,8 +82,6 @@ ffmpegProcess.on('close', () => {
// Cleanup
process.stdout.write('\n\n\n\n');
clearInterval(progressbarHandle);
// Close the programm
process.exit(0);
});

// Link streams
Expand Down
2 changes: 1 addition & 1 deletion lib/cache.js
Expand Up @@ -9,7 +9,7 @@ module.exports = class Cache extends Map {
clearTimeout(super.get(key).tid);
}
super.set(key, {
tid: setTimeout(this.delete.bind(this, key), this.timeout),
tid: setTimeout(this.delete.bind(this, key), this.timeout).unref(),
value,
});
}
Expand Down

0 comments on commit e7ad270

Please sign in to comment.