Why doesn't await Synchronize blocking work in this code?

wanted to implement a 3 s delay in downloading each image, but did not find out the reason why await did not take effect. The code is as follows

axios.get(imgSrc, {
                responseType: "stream"
         }).then(async res => {
            console.log("")
         await pipeSync(res,dirName,type)
            currentNumberPP;
            console.log(currentNumber);
});



function pipeSync(res,dirName,type){
    return new Promise(function (resolve, reject) {
       
           res.data.pipe(fs.createWriteStream(dirName + "/" + (new Date().getTime())+"."+type));
           setTimeout(resolve,3000);
    });
 }
 
 
Mar.23,2021

the reason is that async is only a pseudo Synchronize, which can only guarantee blocking in the current function, but cannot cause global blocking that affects the download queue


.

pipe is not Synchronize

const stream = fs.createWriteStream(dirName + "/" + (new Date().getTime())+"."+type);
stream.on('error', reject);
stream.on('finish', () => {
   // , 3 resolve
   setTimeout(resolve,3000);
});

// 
res.data.pipe(stream);
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5a4df-66f41.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5a4df-66f41.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?