Skip to content

Commit

Permalink
fixed end of line at bottom of file
Browse files Browse the repository at this point in the history
  • Loading branch information
MarketDataApp committed Feb 19, 2024
1 parent 9543657 commit b303a6c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,16 +295,19 @@ func newClient() *MarketDataClient {
// helps in preventing indefinitely hanging requests in case of network issues or slow
// server responses.
//
// # Parameters
//
// - int: The timeout duration in seconds. A duration of 0 means no timeout. By default the client has a timeout of 95 seconds.
// By default the client has a timeout of 95 seconds. The timeout may be lowered, but it cannot be increased.
// Valid timeouts are between 1 and 95 seconds. Setting the timeout to any invalid integer will cause the
// client to use the default timeout of 95 seconds.
//
// # Returns
// # Parameters
//
// - *MarketDataClient: A pointer to the MarketDataClient instance, allowing for method chaining.
func (c *MarketDataClient) Timeout(seconds int) *MarketDataClient {
// - int: The timeout duration in seconds. A duration of 0 means no timeout.
func (c *MarketDataClient) Timeout(seconds int) {
if seconds > 95 || seconds < 0 || seconds == 0 {
seconds = 95
}

c.Client.SetTimeout(time.Duration(seconds) * time.Second)
return c
}

// updateRateLimit updates the client's rate limit information based on the response headers.
Expand Down Expand Up @@ -603,4 +606,4 @@ func (c *MarketDataClient) Token(bearerToken string) error {
}

return fmt.Errorf("invalid token. received non-OK status: %s", resp.Status()) // Return error for non-successful response
}
}

0 comments on commit b303a6c

Please sign in to comment.