BotServer Updates
#118
There was an issue with the BotServer that was causing it to crash clients.
It would try to initiate a connection 5000 times in 10 seconds, which would just keep pushing new operations into HTTP. Operations until it crashed.
This was a quick fix to fix it (it could be improved) but I added it so it'll try to reconnect after 2 seconds, then 4 seconds, 8 seconds, etc.
It also clears out the operation on close (technically this would fix it, but it will still attempt to reconnect over and over and over.)
I also added some new functions
The updated code can be found here on GitHub
Examples:
This was a quick fix to fix it (it could be improved) but I added it so it'll try to reconnect after 2 seconds, then 4 seconds, 8 seconds, etc.
It also clears out the operation on close (technically this would fix it, but it will still attempt to reconnect over and over and over.)
I also added some new functions
- isConnected() - checks to see if connected
- hasListen(topic) - looks for a topic
- resetReconnect() - resets the auto reconnect (added to BotServer.lua)
The updated code can be found here on GitHub
Examples:
if BotServer.isConnected() then
-- DO ACTION
end
if BotServer.hasListen("list") then
-- DO ACTION
-- List already exists
end
11 Mar 2024