Don't synchronize vectors while streaming
This commit is contained in:
parent
9a5e667674
commit
0bdd350b8d
|
@ -77,18 +77,18 @@ async function onVectorizeAllClick() {
|
||||||
let syncBlocked = false;
|
let syncBlocked = false;
|
||||||
|
|
||||||
async function synchronizeChat(batchSize = 5) {
|
async function synchronizeChat(batchSize = 5) {
|
||||||
|
if (!settings.enabled) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await waitUntilCondition(() => !syncBlocked, 500);
|
await waitUntilCondition(() => !syncBlocked && !is_send_press, 1000);
|
||||||
} catch {
|
} catch {
|
||||||
console.log('Vectors: Synchronization blocked by another process');
|
console.log('Vectors: Synchronization blocked by another process');
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!settings.enabled) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
syncBlocked = true;
|
syncBlocked = true;
|
||||||
const context = getContext();
|
const context = getContext();
|
||||||
const chatId = getCurrentChatId();
|
const chatId = getCurrentChatId();
|
||||||
|
|
Loading…
Reference in New Issue