Merge pull request #1834 from lbryio/remove-blob-request-lock

remove blob request asyncio.Lock
This commit is contained in:
Jack Robison 2019-01-31 20:46:01 -05:00 committed by GitHub
commit be6e8744b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,7 +23,6 @@ class BlobExchangeClientProtocol(asyncio.Protocol):
self._blob_bytes_received = 0 self._blob_bytes_received = 0
self._response_fut: asyncio.Future = None self._response_fut: asyncio.Future = None
self._request_lock = asyncio.Lock(loop=self.loop)
def data_received(self, data: bytes): def data_received(self, data: bytes):
if not self.transport or self.transport.is_closing(): if not self.transport or self.transport.is_closing():
@ -130,7 +129,6 @@ class BlobExchangeClientProtocol(asyncio.Protocol):
async def download_blob(self, blob: 'BlobFile') -> typing.Tuple[bool, bool]: async def download_blob(self, blob: 'BlobFile') -> typing.Tuple[bool, bool]:
if blob.get_is_verified(): if blob.get_is_verified():
return False, True return False, True
async with self._request_lock:
try: try:
self.blob, self.writer, self._blob_bytes_received = blob, blob.open_for_writing(), 0 self.blob, self.writer, self._blob_bytes_received = blob, blob.open_for_writing(), 0
self._response_fut = asyncio.Future(loop=self.loop) self._response_fut = asyncio.Future(loop=self.loop)