fix: check and process queued docs even when upload directory is empty
This commit is contained in:
parent
65a4437f78
commit
772f981e7e
1 changed files with 8 additions and 6 deletions
|
|
@ -1052,12 +1052,14 @@ async def run_scanning_process(
|
||||||
total_files = len(new_files)
|
total_files = len(new_files)
|
||||||
logger.info(f"Found {total_files} files to index.")
|
logger.info(f"Found {total_files} files to index.")
|
||||||
|
|
||||||
if not new_files:
|
if new_files:
|
||||||
return
|
# Process all files at once with track_id
|
||||||
|
await pipeline_index_files(rag, new_files, track_id)
|
||||||
# Process all files at once with track_id
|
logger.info(f"Scanning process completed: {total_files} files Processed.")
|
||||||
await pipeline_index_files(rag, new_files, track_id)
|
else:
|
||||||
logger.info(f"Scanning process completed: {total_files} files Processed.")
|
# No new files to index, check if there are any documents in the queue
|
||||||
|
logger.info("No upload file found, check if there are any documents in the queue...")
|
||||||
|
await rag.apipeline_process_enqueue_documents()
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error during scanning process: {str(e)}")
|
logger.error(f"Error during scanning process: {str(e)}")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue