mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Find available port when starting backend plugin
CURA-11067
This commit is contained in:
parent
26e7995588
commit
d4449c680f
2 changed files with 11 additions and 3 deletions
|
@ -83,7 +83,6 @@ class CuraEngineBackend(QObject, Backend):
|
|||
os.path.join(CuraApplication.getInstallPrefix(), "bin"),
|
||||
os.path.dirname(os.path.abspath(sys.executable)),
|
||||
]
|
||||
self._last_backend_plugin_port = self._port + 1000
|
||||
for path in search_path:
|
||||
engine_path = os.path.join(path, executable_name)
|
||||
if os.path.isfile(engine_path):
|
||||
|
@ -205,8 +204,7 @@ class CuraEngineBackend(QObject, Backend):
|
|||
for backend_plugin in backend_plugins:
|
||||
# Set the port to prevent plugins from using the same one.
|
||||
if backend_plugin.getPort() < 1:
|
||||
backend_plugin.setPort(self._last_backend_plugin_port)
|
||||
self._last_backend_plugin_port += 1
|
||||
backend_plugin.setAvailablePort()
|
||||
backend_plugin.start()
|
||||
|
||||
def stopPlugins(self) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue