core (main): log errors during post_init.
This commit is contained in:
parent
b9762ce474
commit
c634204ac7
1 changed files with 6 additions and 2 deletions
|
|
@ -109,7 +109,7 @@ class LiberviaBackend(service.Service):
|
||||||
# XXX: we use callLater here to be sure that the reactor is running when doing
|
# XXX: we use callLater here to be sure that the reactor is running when doing
|
||||||
# post initialisation. This is notably important in background mode where
|
# post initialisation. This is notably important in background mode where
|
||||||
# reactor is run later.
|
# reactor is run later.
|
||||||
reactor.callLater(0, lambda: defer.ensureDeferred(self._post_init()))
|
reactor.callLater(0, self._post_init)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def version(self):
|
def version(self):
|
||||||
|
|
@ -144,7 +144,11 @@ class LiberviaBackend(service.Service):
|
||||||
def bridge_name(self):
|
def bridge_name(self):
|
||||||
return os.path.splitext(os.path.basename(self.bridge.__file__))[0]
|
return os.path.splitext(os.path.basename(self.bridge.__file__))[0]
|
||||||
|
|
||||||
async def _post_init(self):
|
def _post_init(self) -> None:
|
||||||
|
d = defer.ensureDeferred(self.post_init())
|
||||||
|
d.addErrback(lambda e: log.exception(f"Post Init error: {e}"))
|
||||||
|
|
||||||
|
async def post_init(self):
|
||||||
try:
|
try:
|
||||||
self._bridge, __ = await dynamic_import.load_and_init_bridge(
|
self._bridge, __ = await dynamic_import.load_and_init_bridge(
|
||||||
G.config, is_backend=True
|
G.config, is_backend=True
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue