mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-02-06 11:35:22 +01:00
Fix stop() not working and preserve a SystemExit
This commit is contained in:
parent
e61c0bc92b
commit
700e1996c8
1 changed files with 4 additions and 2 deletions
|
|
@ -334,11 +334,13 @@ def serve_forever(self):
|
|||
self.ready = True
|
||||
self.log('calibre server listening on', ba)
|
||||
|
||||
while True:
|
||||
while self.ready:
|
||||
try:
|
||||
self.tick()
|
||||
except (KeyboardInterrupt, SystemExit):
|
||||
except (KeyboardInterrupt, SystemExit) as e:
|
||||
self.shutdown()
|
||||
if isinstance(e, SystemExit):
|
||||
raise
|
||||
break
|
||||
except:
|
||||
self.log.exception('Error in ServerLoop.tick')
|
||||
|
|
|
|||
Loading…
Reference in a new issue