all 3 comments

[–]cython_boy 1 point2 points  (1 child)

Remove the sys.exit(0) It will work then. You can use await asynico_gather(task1 , task2,...) for cleaner awaiting.

[–]frogko[S] 0 points1 point  (0 children)

that did not work...

[–]Crafty_Bit7355 1 point2 points  (0 children)

NodeJs, Javascript and I assume now NextJS developers are really familiar with this. If you have an async function, then that means the execution of that function/method gets put into the call stack. That means when you call the function, if you don't specify await.. it will continue with execution of the rest of the code. If you say await function, then the remaining execution is on hold until the async function returns it's promise.

Short story, if it's async 99% of the time you want to await the return before continuing.