I have a function with a an http request nested inside another as well as loops inside both the requests. I would show it but it's really long and messy and would only confuse things further. I've been trying to make this function run indefinitely but I have been unsuccessful so far
Heres what I tried so far:
while(true){
myFunc();
}
in the above case function simply doesnt run
setInterval(myFunc, 1000);
function starts a new run every 1 second which makes it an absolute mess. The function itself takes around 30 mins to stop running which is 1800000 ms.
setInterval(myFunc, 1800000);
function never runs, didnt wait 30 mins to see if it would start running though
the only thing that "works" is calling it recursively inside an if statement in the function that checks if it's about to finish but this will cause memory leaks.
Any tips on what to do to get the function to run again after it finishes, ad infinitum?