From 0bdd350b8d978b97d533572b467d3153325dd4de Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sun, 10 Sep 2023 20:21:23 +0300 Subject: [PATCH] Don't synchronize vectors while streaming --- public/scripts/extensions/vectors/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/scripts/extensions/vectors/index.js b/public/scripts/extensions/vectors/index.js index b60b3ec60..df51cee3e 100644 --- a/public/scripts/extensions/vectors/index.js +++ b/public/scripts/extensions/vectors/index.js @@ -77,18 +77,18 @@ async function onVectorizeAllClick() { let syncBlocked = false; async function synchronizeChat(batchSize = 5) { + if (!settings.enabled) { + return -1; + } + try { - await waitUntilCondition(() => !syncBlocked, 500); + await waitUntilCondition(() => !syncBlocked && !is_send_press, 1000); } catch { console.log('Vectors: Synchronization blocked by another process'); return -1; } try { - if (!settings.enabled) { - return -1; - } - syncBlocked = true; const context = getContext(); const chatId = getCurrentChatId();