Skip to content

Commit

Permalink
refactor(document/DocumentProcessor.ts): add debug logs and increase …
Browse files Browse the repository at this point in the history
…delay for better traceability

fix(main.ts): fix typo in condition for hiding notice
  • Loading branch information
anpigon committed Nov 29, 2024
1 parent 2580deb commit 1d49532
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/helpers/document/DocumentProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,10 @@ export default class DocumentProcessor {
// Process updates in batches of 100
for (let i = 0; i < updateData.length; i += batchSize) {
const batch = updateData.slice(i, i + batchSize);
this.logger.debug("--→ batch", batch);
await Promise.all(batch.map((data) => this.pineconeIndex.update(data)));
await new Promise((resolve) => setTimeout(resolve, 100));
this.logger.debug("--→ update done");
await new Promise((resolve) => setTimeout(resolve, 1000));
}

this.logger.debug("saveToVectorStore update done");
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default class SmartSeekerPlugin extends Plugin {
new Notice(`❌ 노트 처리 중 오류가 발생했습니다: ${error}`);
} finally {
this.isProcessingFolder = false;
if(notice) {
if (notice) {
notice.hide();
}
}
Expand Down

0 comments on commit 1d49532

Please sign in to comment.