Resolve issue with client reference

This commit is contained in:
Tyler 2019-10-13 00:42:08 -04:00
parent ef903095c9
commit c4c66b5c23
1 changed files with 7 additions and 0 deletions

View File

@ -3,8 +3,10 @@ package gavalink
import (
"errors"
"log"
"net/http"
"os"
"sort"
"time"
)
// Log sets the log.Logger gavalink will write to
@ -50,10 +52,15 @@ func NewLavalink(shards string, userID string) *Lavalink {
func (lavalink *Lavalink) AddNodes(nodeConfigs ...NodeConfig) error {
nodes := make([]*Node, len(nodeConfigs))
client := &http.Client{
Timeout: 60 * time.Second,
}
for i, c := range nodeConfigs {
n := &Node{
config: c,
manager: lavalink,
client: client,
}
err := n.open()