• S sverchok
  • Информация о проекте
    • Информация о проекте
    • Активность
    • Метки
    • Участники
  • Репозиторий
    • Репозиторий
    • Файлы
    • Коммиты
    • Ветки
    • Теги
    • Участники
    • Диаграмма
    • Сравнение
  • Задачи 148
    • Задачи 148
    • Список
    • Доски
    • Спринты
  • Запросы на слияние 21
    • Запросы на слияние 21
  • CI/CD
    • CI/CD
    • Конвейеры
    • Задания
    • Расписания
  • Развертывания
    • Развертывания
    • Окружения
    • Релизы
  • Пакеты и реестры
    • Пакеты и реестры
    • Реестр пакетов
    • Реестр контейнеров
  • Мониторинг
    • Мониторинг
    • Инциденты
  • Аналитика
    • Аналитика
    • Поток ценности
    • CI/CD
    • Репозиторий
  • Wiki
    • Wiki
  • Сниппеты
    • Сниппеты
  • Активность
  • Диаграмма
  • Создать новую задачу
  • Задания
  • Коммиты
  • Доски с задачами
Свернуть панель
  • nikitronn
  • sverchok
  • Задачи
  • #3659
Закр.
Открыто
Задача созд. Окт 20, 2020 пользователемnikitronn@nikitronnВладелец

`throttle tree update` problem

Created by: Durman

Problem statement

Throttle context manager undo eachother.

with throttle_tree_update():
    tree.links.new()
    with throttle_tree_update():
        tree.links.new()
    tree.links.new()  # <- this will triger update

It has matter during importing node tree when whole tree should be created without updates. It is similar to next situation. Electrician is switching off electricity before doing his work. But if electricity was already switched off it would be quite careless to the electrician switched it on because possibly there is another electrcian which is stll worcking some where.

Possible solution is to make only first context manager responsible for unfreezing tree.

@contextmanager
def throttle_tree_update(node):
    has_changed_status = False
    if not node.id_data.skip_tree_update:
        node.id_data.skip_tree_update = True
        has_changed_status = True

    try:
        yield node
    finally:
        if has_changed_status:
             node.id_data.skip_tree_update = False
Ответственный
Назначить
Оценка трудозатрат