Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--reload not working with Quart #16

Closed
McSpidey opened this issue Mar 22, 2019 · 8 comments
Closed

--reload not working with Quart #16

McSpidey opened this issue Mar 22, 2019 · 8 comments

Comments

@McSpidey
Copy link

I've been trying to get Hypercorn + Quart autoreloading on code change working and think I've found a bug.

The Hypercorn usage doc suggests the correct flag is "--reload"
https://github.com/pgjones/hypercorn/blob/master/docs/usage.rst

When I use this it starts fine but the moment I edit the Quart source code file and save it Hypercorn crashes with this error:
"unknown option --reload"

I've checked the Quart docs (https://pgjones.gitlab.io/quart/source/quart.app.html
) and it suggests the internal flag may be "use_reloader", however if I try that with Hypercorn it doesn't start, giving this error.
"hypercorn: error: unrecognized arguments: --use_reloader"

In case it was a mismatch between versions I just tried uninstalling and re-installing both Quart and Hypercorn but there was no change. What's the best way to go about this?

@pgjones
Copy link
Owner

pgjones commented Mar 23, 2019

Could you show the full command you use with --reload and the error trace that goes with it?

@McSpidey
Copy link
Author

McSpidey commented Mar 23, 2019

Unfortunately there is no trace. Here's the full message.

C:\Users\xxx\Dropbox\Python\yyy\Console>hypercorn --reload -w 1 -b 0.0.0.0:80 app:app
Running on 0.0.0.0:80 over http (CTRL + C to quit)
unknown option --reload
usage: c:\users\xxx\.virtualenvs\console-pphxaxy4\scripts\python.exe [option] ... [-c cmd |
-C:\Users\xxx\Dropbox\Python\yyy\Console>m mod | file | -] [arg] ...
Try `python -h' for more information.

I'm using a virtual env, in this case pipenv, and looking at that error it seems the --reload flag is attempting to be interpreted by Python.exe and being rejected.

@pgjones
Copy link
Owner

pgjones commented Mar 25, 2019

I think I fixed this in bb6989d, could you try that?

@McSpidey
Copy link
Author

Confirmed, when I edit that line into my local copy of that file it works. Nice job!

@marodev
Copy link

marodev commented Apr 4, 2019

@McSpidey May I ask you to try it with multiple workers? Is this supported on Windows?

for example:

hypercorn -w 2 -b 0.0.0.0:80 app:app

@pgjones
Copy link
Owner

pgjones commented Apr 4, 2019

@marodev reloading isn't supported with multiple workers. Reloading is a development feature, whereas multiple workers is a production feature so I haven't seen a need for them to work together.

@marodev
Copy link

marodev commented Apr 4, 2019

@pgjones I should have been more precise. I was wondering if hypercorn works with multiple workers on Windows or if that feature is only supported on Unix. That’s why I didn’t provide the reload flag in my example. However, I just read that there is an issue and it doesn't seem to work.

@pgjones
Copy link
Owner

pgjones commented Apr 4, 2019

I see, it should work. If it isn't it would be good to see any errors (or why you think it isn't).

@McSpidey McSpidey closed this as completed Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants