fix(embedding): guard is_multiple_of() progress logs against zero
is_multiple_of(N) returns true for 0, which caused debug/info progress messages to fire at doc_num=0 (the start of every page) rather than only at the intended 50/100 milestones. Add != 0 check to both the debug (every 50) and info (every 100) log sites. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -161,7 +161,7 @@ async fn embed_page(
|
||||
continue;
|
||||
}
|
||||
|
||||
if page_normal_docs.is_multiple_of(50) {
|
||||
if page_normal_docs != 0 && page_normal_docs.is_multiple_of(50) {
|
||||
debug!(
|
||||
doc_id = doc.document_id,
|
||||
doc_num = page_normal_docs,
|
||||
@@ -169,7 +169,7 @@ async fn embed_page(
|
||||
"Chunking document"
|
||||
);
|
||||
}
|
||||
if page_normal_docs.is_multiple_of(100) {
|
||||
if page_normal_docs != 0 && page_normal_docs.is_multiple_of(100) {
|
||||
info!(
|
||||
doc_id = doc.document_id,
|
||||
content_bytes = doc.content_text.len(),
|
||||
|
||||
Reference in New Issue
Block a user