From dcafef918a0c9b1e6169431da5d69cb11a43590f Mon Sep 17 00:00:00 2001 From: SantaSpeen Date: Thu, 13 Jul 2023 09:53:57 +0300 Subject: [PATCH] Minor naming update --- src/core/core.py | 8 +++++--- src/core/core.pyi | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/core.py b/src/core/core.py index 3975a8b..e00e21d 100644 --- a/src/core/core.py +++ b/src/core/core.py @@ -230,7 +230,7 @@ class Core: raise KeyboardInterrupt # noinspection SpellCheckingInspection,PyPep8Naming - async def authenticate(self, test=False): + async def heartbeat(self, test=False): if config.Auth["private"] or self.direct: if test: self.log.info(f"Server runnig in Direct connect mode.") @@ -315,8 +315,10 @@ class Core: self.log.debug("Initializing WebAPI...") web_thread = Thread(target=self.start_web) web_thread.start() + self.log.debug(f"WebAPI started at new thread: {web_thread.name}") self.web_thread = web_thread self.web_stop = webapp._stop + await asyncio.sleep(.3) # Mods handler self.log.debug("Listing mods..") @@ -333,10 +335,10 @@ class Core: if lmods > 0: self.log.info(f"Loaded {lmods} mods: {round(self.mods_list[0] / MB, 2)}mb") - await self.authenticate(True) + await self.heartbeat(True) tasks = [] # self.check_alive() - nrtasks = [self.tcp.start, self.udp.start, console.start, self.stop_me, self.authenticate, ] + nrtasks = [self.tcp.start, self.udp.start, console.start, self.stop_me, self.heartbeat, ] for task in nrtasks: tasks.append(asyncio.create_task(task())) t = asyncio.wait(tasks, return_when=asyncio.FIRST_EXCEPTION) diff --git a/src/core/core.pyi b/src/core/core.pyi index cfc5d81..e2fd4bc 100644 --- a/src/core/core.pyi +++ b/src/core/core.pyi @@ -66,7 +66,7 @@ class Core: def start_web() -> None: ... @staticmethod def stop_me() -> None: ... - async def authenticate(self, test=False) -> None: ... + async def heartbeat(self, test=False) -> None: ... async def main(self) -> None: ... def start(self) -> None: ... def stop(self) -> None: ...