mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-24 16:05:56 +01:00
Retry on broken pipe when writing to control
This commit is contained in:
parent
62a0bdad07
commit
593eeaf9ea
1 changed files with 7 additions and 2 deletions
|
|
@ -648,8 +648,13 @@ def write_to_control(self, what):
|
|||
if iswindows:
|
||||
self.control_in.sendall(what)
|
||||
else:
|
||||
self.control_in.write(what)
|
||||
self.control_in.flush()
|
||||
try:
|
||||
self.control_in.write(what)
|
||||
self.control_in.flush()
|
||||
except BrokenPipeError:
|
||||
self.create_control_connection()
|
||||
self.control_in.write(what)
|
||||
self.control_in.flush()
|
||||
|
||||
def wakeup(self):
|
||||
self.write_to_control(WAKEUP)
|
||||
|
|
|
|||
Loading…
Reference in a new issue