Open ObviouslyGreen opened 7 years ago
Hi, thanks for reporting this,
This is how Python's run_path works by default, it's easy to fix though and surely entering an infinite loop is not a good thing at all. Also I didn't advertise reload too much in the tutorial for the reason of being a draft implementation. Things to do here:
Hi,
I've messing around with japronto and have been enjoying it. I realized that app.Run() had a reload flag, so I wanted to try that. When I used the reload flag, it ended up in a infinite loop, constantly reloading, and calling runner.run(). I passed in '_main_' as run_name to the run_path func and it worked, since I had my code in a main function. I tried without the run_name, running in main and running it outside of it. It worked when I didn't have a main.
This happening to anyone else?
With main (infinite loop):
Without main (works fine):
Host and port being imported from another file
It's not a big deal, just removed the if name equal main condition, but I'm just confused why this happened, wondering if anyone can recreate the issue. I tested in both Ubuntu 14.04 and 16.04 both with python 3.6.
edit: as mentioned below, this is default behavior of run_path, I think I might have read the description for run_module or something on accident