Handle broken pipe error (#572)
This commit is contained in:
parent
3f863eed72
commit
a787ebe7cf
1 changed files with 1 additions and 1 deletions
|
@ -626,7 +626,7 @@ class ServerRequestHandler(http.server.SimpleHTTPRequestHandler):
|
|||
await asyncio.gather(*tasks)
|
||||
generate_result = generate_task.result()
|
||||
return generate_result
|
||||
except ConnectionAbortedError as cae: # attempt to abort if connection lost
|
||||
except (BrokenPipeError, ConnectionAbortedError) as cae: # attempt to abort if connection lost
|
||||
print(cae)
|
||||
handle.abort_generate()
|
||||
time.sleep(0.1) #short delay
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue