def import_metadata(self, task, task_id, file_name, from_client): if not from_client: return adm_server.import_metadata(task, task_id, file_name, from_client) elif self.get_task(): self.__task_locked = False try: return adm_server.import_metadata(task, task_id, file_name, from_client) finally: self.__task_locked = True
def import_metadata(self, task, task_id, file_name, from_client): if not from_client: return adm_server.import_metadata(task, task_id, file_name, from_client) elif self.get_task(): self.__task_locked = False try: return adm_server.import_metadata(task, task_id, file_name, from_client) finally: self.__task_locked = True
def import_metadata(self, task, file_name, from_client): if not self.under_maintenance: with self.admin.lock('$metadata_import'): self.MAINTENANCE = True self.PARAMS_VERSION += 1 self.admin.write_settings() self.save_build_id() self.__task_locked = False try: result = adm_server.import_metadata(task, file_name, from_client) success, error, message = result if success and self.task: self.admin.reload_task() self.admin.update_events_code() self.privileges = None finally: self.__task_locked = True self.MAINTENANCE = False self.PARAMS_VERSION += 1 if success: self.BUILD_VERSION += 1 self.MODIFICATION += 1 self.admin.write_settings() self.save_build_id() return result