put back try catch block for node expansion

This commit is contained in:
Naia Scott 2023-08-24 13:01:45 -04:00
Родитель 27d108eb83
Коммит a87a34b52e
1 изменённых файлов: 19 добавлений и 16 удалений

Просмотреть файл

@ -187,24 +187,27 @@ class ObjectExplorerService(object):
if session is None:
return
# Step 2: Start a task for expanding the node
key = params.node_path
if is_refresh:
task = session.refresh_tasks.get(key)
else:
task = session.expand_tasks.get(key)
try:
# Step 2: Start a task for expanding the node
key = params.node_path
if is_refresh:
task = session.refresh_tasks.get(key)
else:
task = session.expand_tasks.get(key)
if task is not None and task.is_alive():
return
if task is not None and task.is_alive():
return
new_task = threading.Thread(target=self._expand_node_thread, args=(is_refresh, request_context, params, session))
new_task.daemon = True
new_task.start()
new_task = threading.Thread(target=self._expand_node_thread, args=(is_refresh, request_context, params, session))
new_task.daemon = True
new_task.start()
if is_refresh:
session.refresh_tasks[key] = new_task
else:
session.expand_tasks[key] = new_task
if is_refresh:
session.refresh_tasks[key] = new_task
else:
session.expand_tasks[key] = new_task
except Exception as e:
self._expand_node_error(request_context, params, str(e))
def _expand_node_thread(self, is_refresh: bool, request_context: RequestContext, params: ExpandParameters, session: ObjectExplorerSession, retry=False):
try:
@ -220,7 +223,7 @@ class ObjectExplorerService(object):
session.server.refresh()
self._expand_node_thread(is_refresh, request_context, params, session, True)
else:
self._expand_node_error(request_context, params, str(e))
raise e
def _expand_node_error(self, request_context: RequestContext, params: ExpandParameters, message: str):
if self._service_provider.logger is not None: