[JDA Gateway-Worker 1] WARN WebSocketClient - Missed 2 heartbeats! Trying to reconnect... #1735
-
When I start the bot, then in log "[JDA Gateway-Worker 1] WARN WebSocketClient - Missed 2 heartbeats! Trying to reconnect..." this message comes out but my internet is not bad at all(30mbps / 10mbps) and I googled it how to fix it but all answer was internet is bad; please help me :( I'm using raspberry pi 4b 8Gb for hosting bot |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Converting to discussion, since you didn't fill out any of the issue templates. See #1337 |
Beta Was this translation helpful? Give feedback.
-
This means your listener methods take too long to finish. Therefore other events will be delayed and this warning comes up. This can have two reasons:
If it's the first case you should use If it's the second case, you should process such commands on a new Thread. For this you should use a |
Beta Was this translation helpful? Give feedback.
This means your listener methods take too long to finish. Therefore other events will be delayed and this warning comes up. This can have two reasons:
complete()
orsubmit().get()
which will block the current code until the action was done and therefor can take very long.If it's the first case you should use
queue()
with the success consumer instead, where the consumer will be asynchronously executed when the action (such as sending messages, retrieving users, etc.) was done. Read more in the wiki about it.If it's the second case, you should process suc…