Closed xianyunleo closed 2 months ago
请勿并发
Promise.all 在代码里很常见的,就算不写 Promise.all。用一个async方法包裹后,调用此async方法,前面不加await,也同样会报这个错误 @kihlh
const arr = [9005, 3306]
const asyncFunc = async(port)=>{
const pid = await net.getTCPv4PortProcessIDAsync(port)
if (pid) await ProcessExtend.kill(pid)
}
for (const port of arr) {
asyncFunc(port)
}
比如以上的代码,调用 asyncFunc前不加await,也会触发promise的错误 @kihlh
net-win32@1.0.2 中已经修复
throw error : PromiseGetPortProcessID::startWork work_message -> error < Promise workspace has not been released. >