Unverified Kaydet (Commit) 0237265e authored tarafından Andrew Svetlov's avatar Andrew Svetlov Kaydeden (comit) GitHub

Use threadpool for reading from file in sendfile fallback mode (#14076)

üst ef215235
......@@ -1141,7 +1141,7 @@ class BaseEventLoop(events.AbstractEventLoop):
if blocksize <= 0:
return total_sent
view = memoryview(buf)[:blocksize]
read = file.readinto(view)
read = await self.run_in_executor(None, file.readinto, view)
if not read:
return total_sent # EOF
await proto.drain()
......
Use threadpool for reading from file for sendfile fallback mode.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment