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 ( import (
"errors" "errors"
"log" "log"
"net/http"
"os" "os"
"sort" "sort"
"time"
) )
// Log sets the log.Logger gavalink will write to // 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 { func (lavalink *Lavalink) AddNodes(nodeConfigs ...NodeConfig) error {
nodes := make([]*Node, len(nodeConfigs)) nodes := make([]*Node, len(nodeConfigs))
client := &http.Client{
Timeout: 60 * time.Second,
}
for i, c := range nodeConfigs { for i, c := range nodeConfigs {
n := &Node{ n := &Node{
config: c, config: c,
manager: lavalink, manager: lavalink,
client: client,
} }
err := n.open() err := n.open()