Minor naming update

This commit is contained in:
Maxim Khomutov 2023-07-13 09:53:57 +03:00
parent 6e46af4c13
commit dcafef918a
2 changed files with 6 additions and 4 deletions

View File

@ -230,7 +230,7 @@ class Core:
raise KeyboardInterrupt raise KeyboardInterrupt
# noinspection SpellCheckingInspection,PyPep8Naming # noinspection SpellCheckingInspection,PyPep8Naming
async def authenticate(self, test=False): async def heartbeat(self, test=False):
if config.Auth["private"] or self.direct: if config.Auth["private"] or self.direct:
if test: if test:
self.log.info(f"Server runnig in Direct connect mode.") self.log.info(f"Server runnig in Direct connect mode.")
@ -315,8 +315,10 @@ class Core:
self.log.debug("Initializing WebAPI...") self.log.debug("Initializing WebAPI...")
web_thread = Thread(target=self.start_web) web_thread = Thread(target=self.start_web)
web_thread.start() web_thread.start()
self.log.debug(f"WebAPI started at new thread: {web_thread.name}")
self.web_thread = web_thread self.web_thread = web_thread
self.web_stop = webapp._stop self.web_stop = webapp._stop
await asyncio.sleep(.3)
# Mods handler # Mods handler
self.log.debug("Listing mods..") self.log.debug("Listing mods..")
@ -333,10 +335,10 @@ class Core:
if lmods > 0: if lmods > 0:
self.log.info(f"Loaded {lmods} mods: {round(self.mods_list[0] / MB, 2)}mb") self.log.info(f"Loaded {lmods} mods: {round(self.mods_list[0] / MB, 2)}mb")
await self.authenticate(True) await self.heartbeat(True)
tasks = [] tasks = []
# self.check_alive() # 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: for task in nrtasks:
tasks.append(asyncio.create_task(task())) tasks.append(asyncio.create_task(task()))
t = asyncio.wait(tasks, return_when=asyncio.FIRST_EXCEPTION) t = asyncio.wait(tasks, return_when=asyncio.FIRST_EXCEPTION)

View File

@ -66,7 +66,7 @@ class Core:
def start_web() -> None: ... def start_web() -> None: ...
@staticmethod @staticmethod
def stop_me() -> None: ... def stop_me() -> None: ...
async def authenticate(self, test=False) -> None: ... async def heartbeat(self, test=False) -> None: ...
async def main(self) -> None: ... async def main(self) -> None: ...
def start(self) -> None: ... def start(self) -> None: ...
def stop(self) -> None: ... def stop(self) -> None: ...