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

make webserver stoppable once created #198

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kaduvert
Copy link
Contributor

If the bot starting process includes creating a webserver you can't replay it because the default port is already bound and can't be freed
this pr makes freeing possible by adding a stopServer() method

That's useful if you have to recreate your bot sometimes (possibly due to disconnects) but don't want to recreate the whole node process

@rom1504
Copy link
Member

rom1504 commented Dec 17, 2023

not sure on whether to merge more things like this here vs merging one of the massive PRs open

@kaduvert
Copy link
Contributor Author

kaduvert commented Dec 17, 2023

do both.
the open prs don't conflict with each other except for maybe #175, but that's another project anyways..

@sefirosweb
Copy link
Contributor

I need it, sometimes I check the bot to see how it is, but I could launch a task if there is no open connection that automatically stops the service, to improve performance/consumption

@ozaner
Copy link

ozaner commented Aug 4, 2024

I'd like this merged as well. I have a long lived mineflayer node instance, and the bot joins/leaves the server in sync with when another program connects/disconnects to it via websocket.

Not being able to close the webserver means the webserver is stuck with the first bot (cant keep the same bot instance as it cannot disconnect and creating one instantly joins a server).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Waiting for user input
Development

Successfully merging this pull request may close these issues.

4 participants