This repository was archived by the owner on Oct 2, 2024. It is now read-only.
Replace flask dev server with python wsgi server#166
Open
Conversation
dkess
reviewed
Dec 15, 2019
| more-itertools==7.0.0 | ||
| ocflib | ||
| more-itertools==8.0.2 | ||
| ocflib==2019.11.12.16.30 |
| port = os.getenv('HTTP_PORT', 8888) | ||
| app.bot = bot | ||
| app.run(host='0.0.0.0', port=int(port)) | ||
| global create_bot |
Member
There was a problem hiding this comment.
I'm pretty sure using global variables and shared memory in this way is undefined behavior in WSGI's process model, which is why I avoided doing something similar. If this really works reliably then I'm probably OK with it, but I'd make sure to test this extra carefully.
Member
There was a problem hiding this comment.
You're right, which is why we can't use gunicorn for instance. I believe cheroot was picked specifically because it's implemented in Python so this kind of hack will work. Otherwise things will need to be drastically refactored in a painful way. But yeah, this is not ideal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Right now we are using the flask dev server, this change will make it a lot more comfortable to add webhooks in the future.