Skip to content

Commit 598f656

Browse files
committed
Update environment variables with default values only if value has not been set.
1 parent e91244f commit 598f656

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

matlab_proxy/app_state.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -965,10 +965,11 @@ async def __setup_env_for_matlab(self) -> dict:
965965
matlab_env["MLM_LICENSE_FILE"] = self.licensing["conn_str"]
966966

967967
# Env setup related to MATLAB
968-
matlab_env["MW_CRASH_MODE"] = "native"
969-
matlab_env["MATLAB_WORKER_CONFIG_ENABLE_LOCAL_PARCLUSTER"] = "true"
970-
matlab_env["PCT_ENABLED"] = "true"
971-
matlab_env["HTTP_MATLAB_CLIENT_GATEWAY_PUBLIC_PORT"] = "1"
968+
## Update the values only if it does not already exist in the environment
969+
matlab_env["MW_CRASH_MODE"] = matlab_env.get("MW_CRASH_MODE", "native")
970+
matlab_env["MATLAB_WORKER_CONFIG_ENABLE_LOCAL_PARCLUSTER"] = matlab_env.get(
971+
"MATLAB_WORKER_CONFIG_ENABLE_LOCAL_PARCLUSTER", "true"
972+
)
972973
matlab_env["MW_DOCROOT"] = os.path.join("ui", "webgui", "src")
973974
matlab_env["MWAPIKEY"] = self.settings["mwapikey"]
974975

0 commit comments

Comments
 (0)