let status = []
const promises = files.forEach(async (file) => {
let path = ${localPath}/${file}
let info = await imagepredictions(path)
let flag = await fileUpload(info, req, path)console.log("flag", flag);
if (flag) { status.push(info ? info : null) }
console.log("INSIDE ",status);return info, flag;})
await Promise.all(promises);
console.log("outside ",status);
console.log("outside ",status);
** –> I want to wait all async task complete**
** output:- **
outside []
[]
{ class: 'healthy', confidence: 100 }
flag 1
INSIDE [ { class: 'healthy', confidence: 100 } ]
New contributor
Subhajit Garai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.