mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 14:23:53 +00:00
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:
@@ -227,13 +227,13 @@ class Web(blenderbim.core.tool.Web):
|
|||||||
return False
|
return False
|
||||||
webui_path = os.path.join(bpy.context.scene.BIMProperties.data_dir, "webui")
|
webui_path = os.path.join(bpy.context.scene.BIMProperties.data_dir, "webui")
|
||||||
pid_file = os.path.join(webui_path, "running_pid.json")
|
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)
|
data = json.load(f)
|
||||||
if port in data.values():
|
if port in data.values():
|
||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user