瀏覽代碼

Avoid locking the DB when there are no subitems to insert

master
JustAnotherArchivist 3 年之前
父節點
當前提交
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)]


Loading…
取消
儲存