mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
call 'set_tray_server_url' as soon as possible
This commit is contained in:
parent
136da2b470
commit
131afb6684
1 changed files with 9 additions and 2 deletions
|
|
@ -164,13 +164,13 @@ def get_tray_server_url(
|
|||
return None
|
||||
|
||||
|
||||
def set_tray_server_url(tray_url: str, started: bool):
|
||||
def set_tray_server_url(tray_url: Optional[str], started: bool):
|
||||
"""Add tray server information file.
|
||||
|
||||
Called from tray logic, do not use on your own.
|
||||
|
||||
Args:
|
||||
tray_url (str): Webserver url with port.
|
||||
tray_url (Optional[str]): Webserver url with port.
|
||||
started (bool): If tray is started. When set to 'False' it means
|
||||
that tray is starting up.
|
||||
|
||||
|
|
@ -299,5 +299,12 @@ def main():
|
|||
os.kill(pid, signal.SIGTERM)
|
||||
remove_tray_server_url()
|
||||
|
||||
# Prepare the file with 'pid' information as soon as possible
|
||||
try:
|
||||
set_tray_server_url(None, False)
|
||||
except TrayIsRunningError:
|
||||
print("Tray is running")
|
||||
sys.exit(1)
|
||||
|
||||
main()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue