Просмотр исходного кода

Avoid locking the DB when there are no subitems to insert

master
JustAnotherArchivist 3 лет назад
Родитель
Сommit
168fa78736
1 измененных файлов: 2 добавлений и 2 удалений
  1. +2
    -2
      qwarc/__init__.py

+ 2
- 2
qwarc/__init__.py Просмотреть файл

@@ -307,8 +307,8 @@ class QWARC:
self._tasks = pending

async def _insert_subitems(self, item):
async with self.exclusive_db_lock() as cursor:
if item.childItems:
if item.childItems:
async with self.exclusive_db_lock() as cursor:
it = iter(item.childItems)
while True:
values = [(t, v, STATUS_TODO) for t, v in itertools.islice(it, 100000)]


Загрузка…
Отмена
Сохранить