Spaces:
Sleeping
Sleeping
File size: 1,178 Bytes
2fe25c9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
"""
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 |