From 1a51118504d24988eeef6877eccf9e69ade9410f Mon Sep 17 00:00:00 2001 From: aguerre Date: Mon, 13 Jan 2014 13:01:58 +0000 Subject: [PATCH] If concurrent execution mode OFF --- bin/salomeRunner.py | 16 +++++++++------- bin/searchFreePort.py | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/bin/salomeRunner.py b/bin/salomeRunner.py index b96322063..aa1dee6ca 100644 --- a/bin/salomeRunner.py +++ b/bin/salomeRunner.py @@ -267,11 +267,11 @@ class SalomeRunner: def _killAll(self, args=[]): absoluteAppliPath = os.getenv('ABSOLUTE_APPLI_PATH','') try: - import PortManager - ports = PortManager.getBusyPorts() - + import PortManager # mandatory from multiprocessing import Process from killSalomeWithPort import killMyPort + ports = PortManager.getBusyPorts() + if ports: import tempfile for port in ports: @@ -279,13 +279,15 @@ class SalomeRunner: p = Process(target = killMyPort, args=(port,)) p.start() p.join() + + p = Process(target = killMyPort, args=(2809,)) + p.start() + p.join() except ImportError: + from killSalome import killAllPorts + killAllPorts() pass - p = Process(target = killMyPort, args=(2809,)) - p.start() - p.join() - # def _showInfo(self, args=[]): diff --git a/bin/searchFreePort.py b/bin/searchFreePort.py index 0bcc470b2..712ec257b 100644 --- a/bin/searchFreePort.py +++ b/bin/searchFreePort.py @@ -158,6 +158,7 @@ def searchFreePort(args={}, save_config=1, use_port=None): Returns first found free port number. """ try: + import PortManager # mandatory from multiprocessing import Process, Queue queue = Queue() p = Process(target = searchFreePort_withPortManager, args=(queue, args, save_config, use_port,)) -- 2.39.2