1 Star 2 Fork 1

NetAxeClub/SouthDriver

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
gunicorn.conf.py 879 Bytes
一键复制 编辑 原始数据 按行查看 历史
import json
import logging
log = logging.getLogger(__name__)
DEFAULTS_FILENAME = "/code/config/defaults.json"
CONFIG_FILENAME = "/code/config/config.json"
def load_config_files(defaults_filename: str = DEFAULTS_FILENAME, config_filename: str = CONFIG_FILENAME) -> dict:
data = {}
for fname in (defaults_filename, config_filename):
try:
with open(fname) as infil:
data.update(json.load(infil))
except FileNotFoundError:
log.warning(f"Couldn't find {fname}")
if not data:
raise RuntimeError(f"Could not find either {defaults_filename} or {config_filename}")
return data
data = load_config_files()
bind = data["listen_ip"] + ":" + str(data["listen_port"])
workers = data["gunicorn_workers"]
timeout = 3 * 60
keepalive = 24 * 60 * 60
worker_class = "uvicorn.workers.UvicornWorker"
threads = 45
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/NetAxeClub/SouthDriver.git
git@gitee.com:NetAxeClub/SouthDriver.git
NetAxeClub
SouthDriver
SouthDriver
master

搜索帮助