Use parse_duration for fed client timeout/retry options#15778
Use parse_duration for fed client timeout/retry options#15778
Conversation
DMRobertson
left a comment
There was a problem hiding this comment.
Sorry for drive-by while in draft. Do docs need updating?
| self._store = hs.get_datastores().main | ||
| self.version_string_bytes = hs.version_string.encode("ascii") | ||
| self.default_timeout = hs.config.federation.client_timeout | ||
| self.default_timeout = hs.config.federation.client_timeout / 1000 |
There was a problem hiding this comment.
This is in seconds now...
There was a problem hiding this comment.
parse_duration returns milliseconds.
| else: | ||
| _sec_timeout = self.default_timeout | ||
| if timeout is None: | ||
| timeout = int(self.default_timeout) |
There was a problem hiding this comment.
So this is also in seconds now...
There was a problem hiding this comment.
For bonus points, leave a comment saying this is in seconds/milliseconds/whatever.
For a gold star, rename to self.timeout_seconds etc!
| if timeout is None: | ||
| timeout = int(self.default_timeout) | ||
|
|
||
| _sec_timeout = timeout / 1000 |
There was a problem hiding this comment.
which means that this is in kiloseconds if timeout is None, but seconds otherwise. That seems wrong.
Ditto below.
|
@DMRobertson docs do need some update, seems like I did the changes and then didn't commit them... |
|
Superseeded by #15783. |
Pull Request Checklist
(run the linters)