Soumik Bose commited on
Commit ·
1b2d066
1
Parent(s): b267a19
go
Browse files
main.py
CHANGED
|
@@ -228,7 +228,6 @@ async def extract_data(
|
|
| 228 |
"data": {
|
| 229 |
"filename": file.filename,
|
| 230 |
"content_type": file.content_type,
|
| 231 |
-
"saved_file_path": tmp_path,
|
| 232 |
"total_pages": result["total_pages"],
|
| 233 |
"pages_content": result["pages_content"]
|
| 234 |
}
|
|
@@ -248,4 +247,9 @@ async def extract_data(
|
|
| 248 |
)
|
| 249 |
finally:
|
| 250 |
if tmp_path:
|
| 251 |
-
logger.info(f"File preserved at: {tmp_path}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 228 |
"data": {
|
| 229 |
"filename": file.filename,
|
| 230 |
"content_type": file.content_type,
|
|
|
|
| 231 |
"total_pages": result["total_pages"],
|
| 232 |
"pages_content": result["pages_content"]
|
| 233 |
}
|
|
|
|
| 247 |
)
|
| 248 |
finally:
|
| 249 |
if tmp_path:
|
| 250 |
+
logger.info(f"File preserved at: {tmp_path}")
|
| 251 |
+
try:
|
| 252 |
+
os.remove(tmp_path)
|
| 253 |
+
logger.info(f"Temporary file deleted: {tmp_path}")
|
| 254 |
+
except Exception as e:
|
| 255 |
+
logger.warning(f"Failed to delete temp file: {str(e)}")
|