mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-19 13:07:56 +00:00
Use built-in treq timeout feature.
This commit is contained in:
parent
1e50e96e24
commit
414b463556
@ -415,12 +415,10 @@ class StorageClientGeneral(object):
|
||||
Return the version metadata for the server.
|
||||
"""
|
||||
url = self._client.relative_url("/storage/v1/version")
|
||||
result = self._client.request("GET", url)
|
||||
# 1. Getting the version should never take particularly long.
|
||||
# 2. Clients rely on the version command for liveness checks of servers.
|
||||
result.addTimeout(5, self._client._clock)
|
||||
|
||||
response = yield result
|
||||
# Thus, a short timeout.
|
||||
response = yield self._client.request("GET", url, timeout=5)
|
||||
decoded_response = yield _decode_cbor(response, _SCHEMAS["get_version"])
|
||||
returnValue(decoded_response)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user