mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-24 23:26:43 +00:00
Don't bother with persistent connections when testing NURLs.
This commit is contained in:
parent
f8ea650b92
commit
dd07a39399
@ -311,18 +311,20 @@ class StorageClient(object):
|
||||
|
||||
@classmethod
|
||||
def from_nurl(
|
||||
cls,
|
||||
nurl: DecodedURL,
|
||||
reactor,
|
||||
cls, nurl: DecodedURL, reactor, persistent=True, retryAutomatically=True
|
||||
) -> StorageClient:
|
||||
"""
|
||||
Create a ``StorageClient`` for the given NURL.
|
||||
|
||||
``persistent`` and ``retryAutomatically`` arguments are passed to the
|
||||
new HTTPConnectionPool.
|
||||
"""
|
||||
assert nurl.fragment == "v=1"
|
||||
assert nurl.scheme == "pb"
|
||||
swissnum = nurl.path[0].encode("ascii")
|
||||
certificate_hash = nurl.user.encode("ascii")
|
||||
pool = HTTPConnectionPool(reactor)
|
||||
pool = HTTPConnectionPool(reactor, persistent=persistent)
|
||||
pool.retryAutomatically = retryAutomatically
|
||||
pool.maxPersistentPerHost = 20
|
||||
|
||||
if cls.TEST_MODE_REGISTER_HTTP_POOL is not None:
|
||||
|
@ -1203,8 +1203,12 @@ class HTTPNativeStorageServer(service.MultiService):
|
||||
# the HTTP server to talk to, we don't have connection status
|
||||
# updates... https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3978
|
||||
def request(reactor, nurl: DecodedURL):
|
||||
# Since we're just using this one off to check if the NURL
|
||||
# works, no need for persistent pool or other fanciness.
|
||||
return StorageClientGeneral(
|
||||
StorageClient.from_nurl(nurl, reactor)
|
||||
StorageClient.from_nurl(
|
||||
nurl, reactor, persistent=False, retryAutomatically=False
|
||||
)
|
||||
).get_version()
|
||||
|
||||
# LoopingCall.stop() doesn't cancel Deferreds, unfortunately:
|
||||
|
Loading…
Reference in New Issue
Block a user