andrewgross/pyrelic

Client.get_metric_names overrides timeout

Closed this issue · 1 comments

The hardcoded 5.0 timeout on get_metric_names overrides whatever timeout you may have set on a Client's constructor, therefore causes requests to time out when requesting a lot of metrics.

The lines (203-205 of client.py) could be:

        response = self._make_get_request(uri,
                                          parameters=parameters,
                                          timeout=(5.000 if self.timeout < 5.0
                                                         else self.timeout))

Created a pull request for this.