const navTimeout = new Promise((resolve, reject) => {
setInterval(async () => {
try {
await workbook.xlsx.readFile("variables.xlsx")
const sheet = workbook.getWorksheet(1)
if(sheet.getCell('B13').value === "D")
return resolve(true)
} catch (error) {
console.log("Workbook being used")
}
}, 5000)
})
I have the following piece of code. So my doubt is once the promise gets fulfilled and the resolve is done do I need to call clearTimeout() or it will automatically stop executing? I just don't want it to occupy any pc resources.