mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
wait for refresh to finish
This commit is contained in:
parent
8166e4b823
commit
50b4779ad3
1 changed files with 5 additions and 2 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import time
|
||||
import collections
|
||||
import contextlib
|
||||
from abc import ABCMeta, abstractmethod
|
||||
|
|
@ -535,13 +536,15 @@ class HierarchyModel(object):
|
|||
|
||||
def _refresh_tasks_cache(self, project_name, folder_id, sender=None):
|
||||
if folder_id in self._tasks_refreshing:
|
||||
while folder_id in self._tasks_refreshing:
|
||||
time.sleep(0.01)
|
||||
return
|
||||
|
||||
cache = self._task_items[project_name][folder_id]
|
||||
with self._task_refresh_event_manager(
|
||||
project_name, folder_id, sender
|
||||
):
|
||||
task_items = self._query_tasks(project_name, folder_id)
|
||||
self._task_items[project_name][folder_id] = task_items
|
||||
cache.update_data(self._query_tasks(project_name, folder_id))
|
||||
|
||||
def _query_tasks(self, project_name, folder_id):
|
||||
tasks = list(ayon_api.get_tasks(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue