Skip to content

Commit cd59bf5

Browse files
CopilotMte90
andcommitted
Remove unused chunk variables and add embedding API state logging
- Remove unused chunk_text, chunk_size, chunk_preview variables (lines 227-229) - Add embedding API state to timeout diagnostics (API URL, model, timeout, max_retries) - Provides actual API configuration when debugging timeouts Co-authored-by: Mte90 <[email protected]>
1 parent 7fa5d34 commit cd59bf5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ai/analyzer.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,6 @@ def _process_file_sync(
224224
saved_count = 0
225225
failed_count = 0
226226
for idx, chunk_doc, future, embedding_start_time in embedding_futures:
227-
chunk_text = chunk_doc.text
228-
chunk_size = len(chunk_text)
229-
chunk_preview = chunk_text[:200] + "..." if len(chunk_text) > 200 else chunk_text
230-
231227
try:
232228
emb = future.result(timeout=EMBEDDING_TIMEOUT) # Add timeout to prevent hanging indefinitely
233229
embedding_duration = time.time() - embedding_start_time
@@ -271,6 +267,11 @@ def _process_file_sync(
271267
f" - The future.result() call timed out after {EMBEDDING_TIMEOUT}s",
272268
f" - This means the worker thread did not complete the embedding request in time",
273269
f" - Check logs above for messages from the worker thread (search for 'Worker thread')",
270+
f" - Embedding API state:",
271+
f" - API URL: {_embedding_client.api_url}",
272+
f" - Model: {_embedding_client.model}",
273+
f" - API timeout: {_embedding_client.timeout}s",
274+
f" - Max retries: {_embedding_client.max_retries}",
274275
f" - The embedding API logs will show the actual HTTP request state"
275276
])
276277

0 commit comments

Comments
 (0)