mirror of
https://github.com/blw1138/Zordon.git
synced 2025-12-17 16:58:12 +00:00
Fix hostname issue on machines without ".local" in hostname and handle missed TimeOut exception
This commit is contained in:
@@ -542,7 +542,8 @@ def start_server(background_thread=False):
|
|||||||
server.config['MAX_CONTENT_PATH'] = config['max_content_path']
|
server.config['MAX_CONTENT_PATH'] = config['max_content_path']
|
||||||
|
|
||||||
# Get hostname and render clients
|
# Get hostname and render clients
|
||||||
RenderQueue.hostname = socket.gethostname()
|
local_hostname = socket.gethostname()
|
||||||
|
RenderQueue.hostname = local_hostname + (".local" if not local_hostname.endswith(".local") else "")
|
||||||
server.config['HOSTNAME'] = RenderQueue.hostname
|
server.config['HOSTNAME'] = RenderQueue.hostname
|
||||||
|
|
||||||
# disable most Flask logging
|
# disable most Flask logging
|
||||||
|
|||||||
@@ -64,8 +64,11 @@ class RenderServerProxy:
|
|||||||
return req.json()
|
return req.json()
|
||||||
except json.JSONDecodeError as e:
|
except json.JSONDecodeError as e:
|
||||||
logger.debug(f"JSON decode error: {e}")
|
logger.debug(f"JSON decode error: {e}")
|
||||||
|
except requests.ReadTimeout as e:
|
||||||
|
logger.warning(f"Timed out: {e}")
|
||||||
|
self.__offline_flags = self.__offline_flags + 1
|
||||||
except requests.ConnectionError as e:
|
except requests.ConnectionError as e:
|
||||||
logger.error(f"Connection error: {e}")
|
logger.warning(f"Connection error: {e}")
|
||||||
self.__offline_flags = self.__offline_flags + 1
|
self.__offline_flags = self.__offline_flags + 1
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.exception(f"Uncaught exception: {e}")
|
logger.exception(f"Uncaught exception: {e}")
|
||||||
|
|||||||
Reference in New Issue
Block a user