Skip to content

Commit

Permalink
send hostName in /setactive request
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdarkdragon committed Apr 2, 2021
1 parent 797fe98 commit 671a451
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apis/livepeer/livepeer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"io/ioutil"
"net/http"
"os"
"strings"
"time"

Expand All @@ -28,6 +29,8 @@ var defaultHTTPClient = &http.Client{
Timeout: httpTimeout,
}

var hostName, _ = os.Hostname()

const (
// ESHServer GCP? server
ESHServer = "esh.livepeer.live"
Expand Down Expand Up @@ -130,7 +133,8 @@ type (
}

setActiveReq struct {
Active bool `json:"active"`
Active bool `json:"active,omitempty"`
HostName string `json:"hostName,omitempty"`
}
)

Expand Down Expand Up @@ -504,7 +508,8 @@ func (lapi *API) SetActive(id string, active bool) (bool, error) {
start := time.Now()
u := fmt.Sprintf("%s/api/stream/%s/setactive", lapi.choosenServer, id)
ar := setActiveReq{
Active: active,
Active: active,
HostName: hostName,
}
b, _ := json.Marshal(&ar)
req, err := uhttp.NewRequest("PUT", u, bytes.NewBuffer(b))
Expand Down

0 comments on commit 671a451

Please sign in to comment.