Skip to content

The ability for the client to reconnect itself #104

@searinminecraft

Description

@searinminecraft

Summary

Client should reconnect itself when it disconnects from the websocket

What is the feature request for?

The core library

The Problem

I have a systemd user service that starts up my bot on system startup, as follows:

[Unit]
Description=linaSTK
After=multi-user.target
After=network-online.target
Wants=network-online.target

[Service]
WorkingDirectory=%h/Bots/lina
ExecStart=/usr/bin/python %h/Bots/lina/src/main.py
Type=idle
Restart=on-failure
RestartSec=15

[Install]
WantedBy=default.target

The problem is that if the websocket disconnects (which can happen randomly, sometimes after a few hours), it will treat it as if it exited successfully (because it exits with signal 0 if it disconnects) and will not restart the service. If I then the Restart property to always, it would then making shutting down the bot using commands not possible as the init system will restart it afterwards.

The Ideal Solution

There should be a logic in the client where if the websocket was to disconnect, it will attempt to re-establish a connection to the websocket, just like discord.py.

The Current Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions