From 4d1948c68f7cd662f52cc008e6b181a40b13b88a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 30 Dec 2020 12:39:57 +0100 Subject: [PATCH] renamed find_port to find_free_port --- pype/modules/rest_api/rest_api.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pype/modules/rest_api/rest_api.py b/pype/modules/rest_api/rest_api.py index 2a074fd97a..9afb126b12 100644 --- a/pype/modules/rest_api/rest_api.py +++ b/pype/modules/rest_api/rest_api.py @@ -131,9 +131,9 @@ class RestApiModule(PypeModule, ITrayService): module.rest_api_initialization(self) - def find_port(self): start_port = self.default_port exclude_ports = self.exclude_ports + def find_free_port(port_from, port_to=None, exclude_ports=None, host=None): found_port = None # port check takes time so it's lowered to 100 ports for port in range(start_port, start_port+100): @@ -150,7 +150,9 @@ class RestApiModule(PypeModule, ITrayService): return found_port def tray_init(self): - port = self.find_port() + port = self.find_free_port( + self.default_port, self.default_port + 100, self.exclude_ports + ) self.rest_api_url = "http://localhost:{}".format(port) self.rest_api_thread = RestApiThread(self, port) self.register_statics("/res", resources.RESOURCES_DIR)