Hi, I am trying to call function within a for loop, but when I add a closure, the function fails to run. It works in debug mode, but in production mode the function findAllPlaceHits gets hung up and fails to run fully through. I do not think findAllPlaceHits is the problem as it runs in production when it is not enclosed within the closure. I am new to javascript so this may be a simple fix, but I cannot seem to fix the problem. I have attached a screen shot of the code. If I need to provide any more information, let me know. Thanks a lot.
I might be wrong (and Vitaly will correct me), but I believe that the top level function must return Promise.all which wraps all the individual promises within.
Thanks Mark, I’ll try that out and get back to you.
Pat
I think you need something like this:
http://take.ms/6QRwU</img>
http://pastebin.com/GpTUf4hv
ServerCode works well in the DEBUG mode, but does not when deployed to the Cloud
Sync vs Async Code