From eee9796428135dcf9229a28f48b7565688f2d903 Mon Sep 17 00:00:00 2001 From: Silversthorn Date: Sat, 25 Sep 2021 23:08:40 +0200 Subject: [PATCH] Move out_buf in the try method --- app/classes/shared/server.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/classes/shared/server.py b/app/classes/shared/server.py index c93c0e90..68eeb50e 100644 --- a/app/classes/shared/server.py +++ b/app/classes/shared/server.py @@ -188,6 +188,7 @@ class Server: servers_helper.set_waiting_start(self.server_id, False) try: self.process = pexpect.spawn(self.server_command, cwd=self.server_path, timeout=None, encoding='utf-8') + out_buf = ServerOutBuf(self.process, self.server_id) except Exception as ex: msg = "Server {} failed to start with error code: {}".format(self.name, ex) logger.error(msg) @@ -209,8 +210,6 @@ class Server: 'error': translation.translate('error', 'internet') }) - out_buf = ServerOutBuf(self.process, self.server_id) - logger.debug('Starting virtual terminal listener for server {}'.format(self.name)) threading.Thread(target=out_buf.check, daemon=True, name='{}_virtual_terminal'.format(self.server_id)).start()