-
Notifications
You must be signed in to change notification settings - Fork 2.3k
bot can't reply after several hours #276
Comments
Could you post some example code? |
|
@peterswimm any ideas |
I also has this issue, but it's from the internet connection lost (even a few minutes). My solution is try to check if the process can access the internet periodically, if the internet is lost, I'll try to restart the bot. |
@spywhere I'll check it. thank you ~ |
@ringtail Did that solve your issue? |
@peterswimm I solved it by restarting it when it is down. |
You can actually specify the number of retries when you spawn your bot (how many times it will try to reconnect if it loses current connection)
There should be better documentation on this.. |
@YemSalat Instead of increasing the retry count, detecting network changes should be the solution in this case. |
The config property name of code doc |
In some cases, using a finite number of tries, will not be possible. Because one can't determine the amount of time it requires to try to reconnect, because this problem is not based on the amount of tries but based on the change of the network adapter. Therefore, I suggest detecting the network changes and act upon if it is connected. |
@anonrig Note that you can use Infinity for the value of 'retry'. (Indeed it's 'retry', not 'retries'). From Slackbot_worker.js:
|
My bots randomly all disconnect at the exact same time - this happens even when the bots are split across two different boxes running different OSes (albeit on the same network). These disconnects occur every 1-3 days, almost always overnight, and may be tied to slack server maintenance windows for all I know. @anonrig If the preferred behavior is to respond to network changes, can you provide a simple working example of a bot reconnecting itself? |
#261 might be helpful. |
Was noticing the same problem and realized slack was closing the rtm connection or the overall connection had dropped. There is a bug in how the retry attributes are defined and used which causes the retry logic to fail. Reconnect has been working flawlessly since. I also use this code for slack notifications on RTM close and reconnect failures. Hope this helps.
|
bot can't reply after several hours.but It works if I restart the bot.
The text was updated successfully, but these errors were encountered: