So I have a task whcih should create some calendar slots. Now its not important to understand the code. But i think I am creating a task as it should but task like cancels randomly at some point. Also the the terminal logs all want added in the code but the dashboard does not, really wierd.
#task not executing till the end
1 messages · Page 1 of 1 (latest)
Ok I think you're doing async code inside forEach which doesn't work in JavaScript.
It's a really common bug, and it's incredibly annoying that they let you label it with the async word and TypeScript doesn't tell you it doesn't work.
Sentry did a good write up of this: https://sentry.io/answers/are-there-any-issues-with-using-async-await-with-foreach-loops-in-javascript/
So the reason this is failing is because it's not actually waiting for stuff properly. The end of the run function is being reached and then we shut the server down.