Skip to content

Commit

Permalink
Add /heartbeat studio endpoint (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
leszko committed Nov 7, 2023
1 parent 3caebfd commit d3f2b78
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,17 @@ func (lapi *Client) GetSessions(id string, forceUrl bool) ([]UserSession, error)
return sessions, nil
}

// Heartbeat updates the stream session
func (lapi *Client) Heartbeat(id string) error {
if id == "" {
return errors.New("empty id")
}
u := fmt.Sprintf("%s/api/stream/%s/heartbeat", lapi.chosenServer, id)
err := lapi.doRequest("POST", u, "stream", "heartbeat", nil, nil)
glog.Infof("Ran heartbeat request id=%s error=%q", id, err)
return err
}

// SetActive set isActive
func (lapi *Client) SetActive(id string, active bool, startedAt time.Time) (ok bool, err error) {
if id == "" {
Expand Down

0 comments on commit d3f2b78

Please sign in to comment.