def run(self): # log.info("Starting Task \"%s\" in new process" % (self.get_task().get_name())) log_file_name = self.get_task().get_log_file() # TODO change this to get log file in RUN_TASK_EXE cmd = [ TaskInProcess.RUN_TASK_EXE, "--daemon_status_id", str(self.get_daemon_status().get_id()), "--iteration_id", str(self.get_iteration().get_id()), "--task_library", str(self.get_task().get_library_name()), "--task_id", str(self.get_task().get_id()), "--stdout", log_file_name, "--stderr", "STDOUT", ] if log.get_logging_debug(): cmd.append("--debug") if not os.path.exists(os.path.dirname(log_file_name)): os.mkdir(os.path.dirname(log_file_name)) self.__subprocess__ = subprocess.Popen(cmd) # give the Task a chance to start; # this prevents lots of false starts due to unavailable resources # that only are only unavailable to future tasks once this task has kicked off. time.sleep(2)
def run(self): cmd = [SQSTaskInProcess.RUN_TASK_EXE , "--daemon_status_id", str(self.get_daemon_status().get_id()) , "--queue_name", str(self.get_daemon_status().get_region()) , "--stdout", "DEFAULT" , "--stderr", "STDOUT" ] if log.get_logging_debug(): cmd.append("--debug") #log.info(cmd) self.__subprocess__ = subprocess.Popen(cmd) time.sleep(2)