-
Notifications
You must be signed in to change notification settings - Fork 689
Description
(async () =>{
async function fun1(){
let f1 = "D:\\a1.xlsx"
const res1 = await alasql.promise(`select * from xlsx(?) limit 100000`, [f1])
return res1
}
async function fun2(){
let f2 = "D:\\a2.xlsx"
const res2 = await alasql.promise(`select * from xlsx(?) limit 100001`, [f2])
return res2
}
try{
const orderData = await Promise.all([fun1(), fun2()])
console.log(orderData)
}catch(error){
console.error(error);
}finally{
console.log('end');
}
})()
I have an issue where I've created two asynchronous functions, fun1 and fun2, and I want to execute them in batch using Promise.all, passing parameters f1 and f2 to the xlsx(?) placeholder.
When running these functions individually, the query results are correct.
However, when I put them into Promise.all, no results are returned, and no errors are thrown.
After repeated testing, I found that if there is nothing after xlsx(?) in Promise.all, no results are returned. But if I add a limit and the number after limit is different for each function, the correct results are obtained. Yet, if the numbers after limit are the same, no results are returned again.
For example, in the code above, if both are limit 1000, no results are returned. But if one is limit 1000 and the other is limit 1001, the correct results can be obtained.
What could be the reason for this?