Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Use werkzeug make_server for starting & shutdown #105

Merged
merged 4 commits into from
Oct 21, 2022
Merged

Conversation

T4rk1n
Copy link
Contributor

@T4rk1n T4rk1n commented Oct 18, 2022

Replace the start of the server by calling make_server from werkzeug which can then be used to shutdown the server properly.

@alexcjohnson
Copy link
Collaborator

OK maybe a little unlikely, mostly this works great in my testing, but I did find a way to break it. I noticed when I ran two apps, one on the default port and one on port=8051, then app._servers looked like this:

{('127.0.0.1', '8050'): <werkzeug.serving.ThreadedWSGIServer at 0x121b394e0>,
 ('127.0.0.1', 8051): <werkzeug.serving.ThreadedWSGIServer at 0x1226cdde0>}

So then I tried to rerun the second app, but instead of port=8051 I used port='8051', and THAT gave:

OSError: [Errno 48] Address already in use

Simple fix, just coerce port to be an integer instead of a string.

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

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

💃 after considering #105 (comment)

@aiqc
Copy link
Contributor

aiqc commented Jan 3, 2023

Does this also address the dreaded #33?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants