Skip to content

Added an exit if the socket is closed for 10 min#101

Open
tacoroumen wants to merge 1 commit intothomst08:masterfrom
tacoroumen:disconnect-no-reconnect
Open

Added an exit if the socket is closed for 10 min#101
tacoroumen wants to merge 1 commit intothomst08:masterfrom
tacoroumen:disconnect-no-reconnect

Conversation

@tacoroumen
Copy link
Copy Markdown

As per #99

@thomst08
Copy link
Copy Markdown
Owner

Hey @tacoroumen,

Oh yeah.... Yeah, that should do it :)
Awesome work, will check it out (after the other commits)

@gabemeola
Copy link
Copy Markdown

@tacoroumen I'm not familiar with this code, but if it's simple enough to detect and exit, could it attempt to reconnect instead?

We could still exit if it couldn't reconnect after say 3 times.

@tacoroumen
Copy link
Copy Markdown
Author

Hey @gabemeola I'm assuming it would already try and reconnect. But I'm not sure maybe @thomst08 knows this? If it doesn't reconnect after a disconnect we could also add this yes.

@thomst08
Copy link
Copy Markdown
Owner

But I'm not sure maybe @thomst08 knows this? If it doesn't reconnect after a disconnect we could also add this yes.

This is a little tricky to know exactly.... Short answer is I don't know.
There has been times when D#+ crashes in the background and does not trigger any calls to functions I have, so I do not know when the bot is dead but still running. I am not sure if in this case it will catch it or not, it depends.... Honestly, only testing it will know for sure.... We will need to know how to crash it consistently and is predictable ways.

We could still exit if it couldn't reconnect after say 3 times.

I like the idea and know where your coming from, but if D#+ crashes in the background, I haven't had success restarting the bot without closing the program and reopening it, even when rebuilding the bot without a restart, it seems to crash in the library in the backend and I couldn't find a way of reloading it. But this might be unrelated to this issue, just a note.

@tacoroumen, you have got the check in the right spot, but I am unsure if that's what we want to look for, what happens when the bot crashes in other ways? Will it kill it when it's about to restart? I am not sure at the moment. But at a guess, it's a good idea and worth exploring.

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.

3 participants