Limit file deletion to current directory only after document cleaning
This commit is contained in:
parent
c7b566f6d5
commit
910c6973f3
1 changed files with 2 additions and 2 deletions
|
|
@ -1301,11 +1301,11 @@ def create_document_routes(
|
||||||
"Starting to delete files in input directory"
|
"Starting to delete files in input directory"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Delete all files in input_dir
|
# Delete only files in the current directory, preserve files in subdirectories
|
||||||
deleted_files_count = 0
|
deleted_files_count = 0
|
||||||
file_errors_count = 0
|
file_errors_count = 0
|
||||||
|
|
||||||
for file_path in doc_manager.input_dir.glob("**/*"):
|
for file_path in doc_manager.input_dir.glob("*"):
|
||||||
if file_path.is_file():
|
if file_path.is_file():
|
||||||
try:
|
try:
|
||||||
file_path.unlink()
|
file_path.unlink()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue