Spaces:
Running
Running
Commit
·
3508d64
1
Parent(s):
92cce12
Fix upload path to be part of environment vairiable
Browse files- config/config.py +1 -1
- src/implementations/document_service.py +1 -1
- src/main.py +1 -1
- src/utils/drive_document_processor.py +1 -1
config/config.py
CHANGED
@@ -74,7 +74,7 @@ class Settings:
|
|
74 |
TEMP_DOWNLOAD_DIR = os.getenv('TEMP_DOWNLOAD_DIR', './temp_downloads')
|
75 |
|
76 |
# Uploads directory for storing uploaded files
|
77 |
-
UPLOADS_DIR = os.getenv('UPLOADS_DIR', '/app/uploads')
|
78 |
|
79 |
# Application Configuration
|
80 |
DEBUG = os.getenv('DEBUG', 'False') == 'True'
|
|
|
74 |
TEMP_DOWNLOAD_DIR = os.getenv('TEMP_DOWNLOAD_DIR', './temp_downloads')
|
75 |
|
76 |
# Uploads directory for storing uploaded files
|
77 |
+
UPLOADS_DIR = os.getenv('UPLOADS_DIR', '/home/user/app/uploads')
|
78 |
|
79 |
# Application Configuration
|
80 |
DEBUG = os.getenv('DEBUG', 'False') == 'True'
|
src/implementations/document_service.py
CHANGED
@@ -24,7 +24,7 @@ class DocumentService:
|
|
24 |
self.doc_processor = doc_processor
|
25 |
self.mongodb = mongodb
|
26 |
self.permanent_dir = Path(settings.UPLOADS_DIR)
|
27 |
-
self.permanent_dir.mkdir(exist_ok=True)
|
28 |
|
29 |
async def check_duplicate_filename(self, filename: str) -> bool:
|
30 |
"""
|
|
|
24 |
self.doc_processor = doc_processor
|
25 |
self.mongodb = mongodb
|
26 |
self.permanent_dir = Path(settings.UPLOADS_DIR)
|
27 |
+
self.permanent_dir.mkdir(parents=True, exist_ok=True)
|
28 |
|
29 |
async def check_duplicate_filename(self, filename: str) -> bool:
|
30 |
"""
|
src/main.py
CHANGED
@@ -74,7 +74,7 @@ mongodb = MongoDBStore(settings.MONGODB_URI)
|
|
74 |
# Create uploads directory if it doesn't exist
|
75 |
# UPLOADS_DIR = Path("uploads")
|
76 |
UPLOADS_DIR = Path(settings.UPLOADS_DIR)
|
77 |
-
UPLOADS_DIR.mkdir(exist_ok=True)
|
78 |
|
79 |
# Initialize core components
|
80 |
doc_processor = DocumentProcessor()
|
|
|
74 |
# Create uploads directory if it doesn't exist
|
75 |
# UPLOADS_DIR = Path("uploads")
|
76 |
UPLOADS_DIR = Path(settings.UPLOADS_DIR)
|
77 |
+
UPLOADS_DIR.mkdir(parents=True, exist_ok=True)
|
78 |
|
79 |
# Initialize core components
|
80 |
doc_processor = DocumentProcessor()
|
src/utils/drive_document_processor.py
CHANGED
@@ -37,7 +37,7 @@ class DriveDocumentProcessor:
|
|
37 |
self.mongodb = mongodb # Store MongoDB instance
|
38 |
|
39 |
# Create temp directory if it doesn't exist
|
40 |
-
self.temp_dir.mkdir(exist_ok=True)
|
41 |
|
42 |
# Define supported MIME types
|
43 |
self.supported_mime_types = {
|
|
|
37 |
self.mongodb = mongodb # Store MongoDB instance
|
38 |
|
39 |
# Create temp directory if it doesn't exist
|
40 |
+
self.temp_dir.mkdir(parents=True, exist_ok=True)
|
41 |
|
42 |
# Define supported MIME types
|
43 |
self.supported_mime_types = {
|