Resolve issue with client reference
This commit is contained in:
parent
ef903095c9
commit
c4c66b5c23
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue