Don't synchronize vectors while streaming

This commit is contained in:
Cohee 2023-09-10 20:21:23 +03:00
parent 9a5e667674
commit 0bdd350b8d
1 changed files with 5 additions and 5 deletions

View File

@ -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();