예제 #1
0
 def launch_application(self, app_id):
     if not self.is_app_running(app_id):
         self.socket.send(commands.LaunchCommand(app_id))
         start_time = time.time()
         while not self.is_app_running(app_id):
             self.socket.send_and_wait(commands.StatusCommand())
             current_time = time.time()
             if current_time - start_time > self.timeout:
                 raise TimeoutException()
             time.sleep(self.WAIT_INTERVAL)
     else:
         logger.debug('Starting not necessary. Application is running ...')
예제 #2
0
 def launch_application(self, app_id):
     if not self.is_app_running(app_id):
         self.socket.send(commands.LaunchCommand(app_id))
         retries = 0
         while not self.is_app_running(app_id):
             if retries > self.max_retries:
                 return False
             self.socket.send_and_wait(commands.StatusCommand())
             time.sleep(1)
             retries += 1
         return True
     else:
         logger.debug('Starting not necessary. Application is running ...')
         return True