mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
Fix stop() not working and preserve a SystemExit
This commit is contained in:
parent
e61c0bc92b
commit
700e1996c8
@ -334,11 +334,13 @@ class ServerLoop(object):
|
|||||||
self.ready = True
|
self.ready = True
|
||||||
self.log('calibre server listening on', ba)
|
self.log('calibre server listening on', ba)
|
||||||
|
|
||||||
while True:
|
while self.ready:
|
||||||
try:
|
try:
|
||||||
self.tick()
|
self.tick()
|
||||||
except (KeyboardInterrupt, SystemExit):
|
except (KeyboardInterrupt, SystemExit) as e:
|
||||||
self.shutdown()
|
self.shutdown()
|
||||||
|
if isinstance(e, SystemExit):
|
||||||
|
raise
|
||||||
break
|
break
|
||||||
except:
|
except:
|
||||||
self.log.exception('Error in ServerLoop.tick')
|
self.log.exception('Error in ServerLoop.tick')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user