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

Replace flask dev server with python wsgi server #166

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fydai
Copy link
Contributor

@fydai fydai commented Dec 15, 2019

Right now we are using the flask dev server, this change will make it a lot more comfortable to add webhooks in the future.

more-itertools==7.0.0
ocflib
more-itertools==8.0.2
ocflib==2019.11.12.16.30
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove version number

port = os.getenv('HTTP_PORT', 8888)
app.bot = bot
app.run(host='0.0.0.0', port=int(port))
global create_bot
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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

Successfully merging this pull request may close these issues.

None yet

3 participants