Spaces:
Sleeping
Sleeping
Commit
·
24728c9
1
Parent(s):
afd53d1
first commmit
Browse files
app.py
CHANGED
@@ -6,15 +6,6 @@ from typing import List
|
|
6 |
|
7 |
app = FastAPI()
|
8 |
|
9 |
-
import logging
|
10 |
-
|
11 |
-
# Configure logging
|
12 |
-
logging.basicConfig(
|
13 |
-
filename='app.log', # Log file path
|
14 |
-
level=logging.ERROR, # Minimum severity level to log (e.g., ERROR, WARNING, INFO)
|
15 |
-
format='%(asctime)s %(levelname)s: %(message)s',
|
16 |
-
datefmt='%Y-%m-%d %H:%M:%S')
|
17 |
-
|
18 |
# Get the secret key from environment variable
|
19 |
SECRET_KEY = "123"
|
20 |
def cleanup_directory(path: str):
|
@@ -74,6 +65,6 @@ def upload_files(
|
|
74 |
return FileResponse(zip_filename, media_type='application/zip', filename=zip_filename)
|
75 |
|
76 |
except Exception as e:
|
77 |
-
logging.error(f"Error occurred: {str(e)}")
|
78 |
cleanup_directory(main_path)
|
79 |
raise HTTPException(status_code=500, detail=str(e))
|
|
|
6 |
|
7 |
app = FastAPI()
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
# Get the secret key from environment variable
|
10 |
SECRET_KEY = "123"
|
11 |
def cleanup_directory(path: str):
|
|
|
65 |
return FileResponse(zip_filename, media_type='application/zip', filename=zip_filename)
|
66 |
|
67 |
except Exception as e:
|
68 |
+
# logging.error(f"Error occurred: {str(e)}")
|
69 |
cleanup_directory(main_path)
|
70 |
raise HTTPException(status_code=500, detail=str(e))
|