mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Report a failure to compile as a start failure
This commit is contained in:
parent
db4ba63005
commit
ad1c1e7575
@ -80,6 +80,18 @@ class Server(object):
|
|||||||
def serve_forever(self):
|
def serve_forever(self):
|
||||||
self.exception = None
|
self.exception = None
|
||||||
from calibre.srv.content import reset_caches
|
from calibre.srv.content import reset_caches
|
||||||
|
try:
|
||||||
|
_df = os.environ.get('CALIBRE_DEVELOP_FROM', None)
|
||||||
|
if _df and os.path.exists(_df):
|
||||||
|
from calibre.utils.rapydscript import compile_srv
|
||||||
|
compile_srv()
|
||||||
|
except BaseException as e:
|
||||||
|
if self.start_failure_callback is not None:
|
||||||
|
try:
|
||||||
|
self.start_failure_callback(as_unicode(e))
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
return
|
||||||
if self.state_callback is not None:
|
if self.state_callback is not None:
|
||||||
try:
|
try:
|
||||||
self.state_callback(True)
|
self.state_callback(True)
|
||||||
@ -87,10 +99,6 @@ class Server(object):
|
|||||||
pass
|
pass
|
||||||
reset_caches() # we reset the cache as the server tdir has changed
|
reset_caches() # we reset the cache as the server tdir has changed
|
||||||
try:
|
try:
|
||||||
_df = os.environ.get('CALIBRE_DEVELOP_FROM', None)
|
|
||||||
if _df and os.path.exists(_df):
|
|
||||||
from calibre.utils.rapydscript import compile_srv
|
|
||||||
compile_srv()
|
|
||||||
self.loop.serve_forever()
|
self.loop.serve_forever()
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
self.exception = e
|
self.exception = e
|
||||||
|
Loading…
x
Reference in New Issue
Block a user