Spaces:
Sleeping
Sleeping
| """ | |
| Cloud deployment configuration for Job Recommendation API | |
| """ | |
| import os | |
| # Cloud deployment settings | |
| CLOUD_DEPLOYMENT = os.getenv("CLOUD_DEPLOYMENT", "false").lower() == "true" | |
| # Timeout configurations | |
| if CLOUD_DEPLOYMENT: | |
| # Longer timeouts for cloud environments | |
| EXTERNAL_API_TIMEOUT = 120 # 2 minutes | |
| LOGIN_TIMEOUT = 30 | |
| MAX_JOBS_TO_ANALYZE = 10 | |
| REQUEST_TIMEOUT = 300 # 5 minutes total | |
| else: | |
| # Standard timeouts for local development | |
| EXTERNAL_API_TIMEOUT = 60 # 1 minute | |
| LOGIN_TIMEOUT = 10 | |
| MAX_JOBS_TO_ANALYZE = 20 | |
| REQUEST_TIMEOUT = 180 # 3 minutes total | |
| # Retry configurations | |
| MAX_RETRIES = 3 | |
| RETRY_DELAY_BASE = 2 # seconds | |
| # Database configurations for cloud | |
| if CLOUD_DEPLOYMENT: | |
| DB_POOL_SIZE = 5 | |
| DB_MAX_OVERFLOW = 10 | |
| DB_POOL_TIMEOUT = 30 | |
| else: | |
| DB_POOL_SIZE = 10 | |
| DB_MAX_OVERFLOW = 20 | |
| DB_POOL_TIMEOUT = 30 | |
| # Logging configuration | |
| LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO") | |
| LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s' | |
| # Performance monitoring | |
| ENABLE_PERFORMANCE_MONITORING = CLOUD_DEPLOYMENT | |
| PERFORMANCE_LOG_INTERVAL = 10 # seconds |