mirror of
https://github.com/lovell/sharp.git
synced 2025-07-10 02:50:15 +02:00
Wait for close event before decompressing tarball
Should reduce the chance of a race condition
This commit is contained in:
parent
50848ee462
commit
2ce9e81d80
@ -11,6 +11,6 @@ environment:
|
||||
install:
|
||||
- ps: Install-Product node $env:nodejs_version x64
|
||||
- npm install -g npm@5.3.x
|
||||
- appveyor-retry npm install
|
||||
- npm install
|
||||
test_script:
|
||||
- npm test
|
||||
|
@ -70,7 +70,7 @@ module.exports.download_vips = function () {
|
||||
const tarFilename = ['libvips', minimumLibvipsVersion, currentPlatformId].join('-') + '.tar.gz';
|
||||
// Download to per-process temporary file
|
||||
const tarPathTemp = path.join(os.tmpdir(), `${process.pid}-${tarFilename}`);
|
||||
const tmpFile = fs.createWriteStream(tarPathTemp).on('finish', function () {
|
||||
const tmpFile = fs.createWriteStream(tarPathTemp).on('close', function () {
|
||||
unpack(tarPathTemp, function () {
|
||||
// Attempt to remove temporary file
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user