I'd like to convert a recursive function with setTimeout to a node-cron job, but am not sure how to return the parameters:
async function Infinite(page, initData, updateData = new Map()) {
// Check for updates
// If found add to updateData
// Delay function
return Infinite(page, initData, updateData);
}
to
cron.schedule('*/15 8-18 * * *', (/*page, initData, updateData = new Map() ??*/) => {
// Check for updates
// If found add to updateData
// return ???
}
I imagine there will need to be IIFE placed in there somewhere, any help is welcome!