fix pid file not there on first run so exception was thrown and not caught

when the user ran the web ui for the first time. the running_pid file was not created yet by the server so it threw an exception due to with open not inside the try block
This commit is contained in:
Ziad-I
2024-07-30 18:18:35 +03:00
parent 6012695cfe
commit 51463ab674
+4 -4
View File
@@ -227,13 +227,13 @@ class Web(blenderbim.core.tool.Web):
return False
webui_path = os.path.join(bpy.context.scene.BIMProperties.data_dir, "webui")
pid_file = os.path.join(webui_path, "running_pid.json")
with open(pid_file, "r") as f:
try:
try:
with open(pid_file, "r") as f:
data = json.load(f)
if port in data.values():
return True
except:
pass
except:
pass
time.sleep(0.1)
@classmethod