87f2845483
- Cleaned up whitespace and formatting in various files including http.py, language.py, logger.py, safe_exec.py, and SQL migration scripts. - Consolidated import statements and removed unnecessary blank lines. - Updated logging configuration for better clarity. - Enhanced the safe execution code with improved error handling and logging. - Removed commented-out code and unnecessary variables in backfill_zero_trades.py and other scripts. - Added a pyproject.toml for Ruff and Vulture configuration. - Introduced requirements-dev.txt for development dependencies. - Removed commented-out stock entries in init.sql for cleaner migration scripts.
38 lines
724 B
Python
38 lines
724 B
Python
"""
|
|
Gunicorn configuration file (production environment)
|
|
"""
|
|
|
|
import multiprocessing
|
|
|
|
# server socket
|
|
bind = "0.0.0.0:5000"
|
|
backlog = 2048
|
|
|
|
# Worker process
|
|
workers = multiprocessing.cpu_count() * 2 + 1
|
|
worker_class = "sync"
|
|
worker_connections = 1000
|
|
timeout = 600 # 10 minutes for long-running backtests
|
|
keepalive = 5
|
|
|
|
# log
|
|
accesslog = "logs/access.log"
|
|
errorlog = "logs/error.log"
|
|
loglevel = "info"
|
|
access_log_format = '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" %(D)s'
|
|
|
|
# Process naming
|
|
proc_name = "quantdinger_python_api"
|
|
|
|
# Server mechanism
|
|
daemon = False
|
|
pidfile = "logs/gunicorn.pid"
|
|
umask = 0
|
|
user = None
|
|
group = None
|
|
tmp_upload_dir = None
|
|
|
|
# SSL (if required)
|
|
# keyfile = None
|
|
# certfile = None
|