Skip to content

Commit

Permalink
Add host to LockPull (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
leszko committed Mar 28, 2024
1 parent ad476ea commit cfa43b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api.go
Original file line number Diff line number Diff line change
Expand Up @@ -910,13 +910,14 @@ func (lapi *Client) Heartbeat(id string) error {
}

// LockPull locks the stream pull
func (lapi *Client) LockPull(id string, leaseTimeoutMs time.Duration) error {
func (lapi *Client) LockPull(id string, leaseTimeoutMs time.Duration, host string) error {
if id == "" {
return errors.New("empty id")
}

payload := map[string]interface{}{
"leaseTimeout": leaseTimeoutMs,
"host": host,
}
u := fmt.Sprintf("%s/api/stream/%s/lockPull", lapi.chosenServer, id)
err := lapi.doRequest("POST", u, "stream", "lock_pull", payload, nil)
Expand Down

0 comments on commit cfa43b3

Please sign in to comment.