Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion hipchat.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,14 @@ func (c *Client) Say(roomId, name, body string) {
// character to HipChat every 60 seconds. This keeps the connection from
// idling after 150 seconds.
func (c *Client) KeepAlive() {
for _ = range time.Tick(60 * time.Second) {
c.KeepAliveBy(60)
}

// KeepAlive is meant to run as a goroutine. It sends a single whitespace
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think KeepAlive should be KeepAliveBy? Just a copy-paste typo I think

// character to HipChat every arbitrary seconds. This keeps the connection from
// idling after 150 seconds.
func (c *Client) KeepAliveBy(sec time.Duration) {
for _ = range time.Tick(sec * time.Second) {
c.connection.KeepAlive()
}
}
Expand Down