def __init__(self, task_info): super().__init__() self.daemon = True self.info = deepcopy(task_info) # Move API key out of the task info message so that it does not get into # logs. self._user_api_key = self.info.pop('user_api_key', None) self.dir_task = osp.join(constants.AGENT_TASKS_DIR(), str(self.info['task_id'])) self.dir_logs = osp.join(self.dir_task, 'logs') sly.fs.mkdir(self.dir_task) sly.fs.mkdir(self.dir_logs) self.dir_task_host = osp.join(constants.AGENT_TASKS_DIR_HOST(), str(self.info['task_id'])) self._stop_log_event = threading.Event() self._stop_event = multiprocessing.Event() # pre-init for static analysis self.logger = None self.log_queue = None self.executor_log = None self.future_log = None self.api = None self.data_mgr = None self.public_api = None self.public_api_context = None
def __init__(self, task_info): super().__init__() self.daemon = True self.info = task_info self.dir_task = osp.join(constants.AGENT_TASKS_DIR(), str(self.info['task_id'])) self.dir_logs = osp.join(self.dir_task, 'logs') sly.fs.mkdir(self.dir_task) sly.fs.mkdir(self.dir_logs) self.dir_task_host = osp.join(constants.AGENT_TASKS_DIR_HOST(), str(self.info['task_id'])) self._stop_log_event = threading.Event() self._stop_event = multiprocessing.Event() # pre-init for static analysis self.logger = None self.log_queue = None self.executor_log = None self.future_log = None self.api = None self.data_mgr = None self.public_api = None self.public_api_context = None
def init_task_dir(self): self.dir_task = osp.join(constants.AGENT_TASKS_DIR(), str(self.info['task_id'])) self.dir_task_host = osp.join(constants.AGENT_TASKS_DIR_HOST(), str(self.info['task_id']))