-
-
Notifications
You must be signed in to change notification settings - Fork 315
LavalinkNodeConnection is cached before a successful connection is made #321
Copy link
Copy link
Closed
Labels
Milestone
Description
Summary
The LavaLinkExtention will cache a LavalinkNodeConnection even if the connection to the socket was not successful.
Details
Example:
Line 53: The connection is not cached.
Line 59: The connection gets put into the cache.
Line 60: The connection fails (Network issue, ect)
Bug: The connection is still in the cache and will be returned on the next ConnectAsync call.
DSharpPlus/DSharpPlus.Lavalink/LavalinkExtension.cs
Lines 53 to 62 in f0737fa
| if (this.ConnectedNodes.ContainsKey(config.SocketEndpoint)) | |
| return this.ConnectedNodes[config.SocketEndpoint]; | |
| var con = new LavalinkNodeConnection(this.Client, config); | |
| con.NodeDisconnected += this.Con_NodeDisconnected; | |
| con.Disconnected += this.Con_Disconnected; | |
| this.ConnectedNodes[con.NodeEndpoint] = con; | |
| await con.StartAsync().ConfigureAwait(false); | |
| return con; |
Reactions are currently unavailable