diff --git a/client/ayon_core/tools/tray/lib.py b/client/ayon_core/tools/tray/lib.py index 198382b44c..66a494b727 100644 --- a/client/ayon_core/tools/tray/lib.py +++ b/client/ayon_core/tools/tray/lib.py @@ -176,9 +176,9 @@ def set_tray_server_url(tray_url: str, started: bool): """ file_info = get_tray_file_info() - if file_info and file_info.get("pid") != os.getpid(): - tray_url = file_info.get("url") - if _get_tray_information(tray_url): + if file_info and file_info["pid"] != os.getpid(): + tray_url = file_info["url"] + if not file_info["started"] or _get_tray_information(tray_url): raise TrayIsRunningError("Tray is already running.") filepath = _get_tray_info_filepath() @@ -281,14 +281,13 @@ def main(): state = get_tray_state() if state == TrayState.RUNNING: - # TODO send some information to tray? print("Tray is already running.") return if state == TrayState.STARTING: + # TODO try to handle stuck tray? print("Tray is starting.") return - # TODO try to handle stuck tray? time.sleep(5) state = get_tray_state() if state == TrayState.RUNNING: