mirror of
https://gitee.com/mao-peng/MangoTestingPlatform.git
synced 2025-12-06 20:04:44 +08:00
移除线程池
This commit is contained in:
Binary file not shown.
@@ -32,6 +32,7 @@ class JwtQueryParamsAuthentication(BaseAuthentication):
|
||||
except jwt.InvalidTokenError:
|
||||
raise AuthenticationFailed({'code': 303, 'msg': 'token 非法,请使用有效的 token', 'data': None})
|
||||
except Exception as e:
|
||||
|
||||
raise AuthenticationFailed({'code': 304, 'msg': f'token 验证失败: {str(e)}', 'data': None})
|
||||
return payload, token
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ CHANNEL_LAYERS = {
|
||||
if not IS_SQLITE:
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'dj_db_conn_pool.backends.mysql',
|
||||
'ENGINE': 'django.db.backends.mysql',
|
||||
'NAME': MYSQL_DB_NAME,
|
||||
'USER': MYSQL_USER,
|
||||
'PASSWORD': MYSQL_PASSWORD,
|
||||
@@ -130,17 +130,6 @@ if not IS_SQLITE:
|
||||
'isolation_level': 'READ COMMITTED',
|
||||
'autocommit': True,
|
||||
},
|
||||
'POOL_OPTIONS': {
|
||||
'POOL_SIZE': 20, # 增加连接池大小
|
||||
'MAX_OVERFLOW': 30, # 增加最大溢出
|
||||
'RECYCLE': 3600, # 延长回收时间到1小时
|
||||
'TIMEOUT': 30, # 增加获取连接超时到30秒
|
||||
'PRE_PING': True, # 保持开启
|
||||
'ECHO': False, # 关闭SQL日志
|
||||
'MAX_POOL_SIZE': 50, # 增加最大池大小限制
|
||||
'POOL_RECYCLE': 3600, # 明确指定池回收
|
||||
},
|
||||
'CONN_MAX_AGE': 3600, # 改为3600秒,与RECYCLE一致
|
||||
}
|
||||
}
|
||||
else:
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description: Uvicorn启动脚本
|
||||
# @Time : 2025/12/3
|
||||
# @Author : AI助手
|
||||
# @Author :
|
||||
|
||||
import uvicorn
|
||||
import os
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 获取环境变量
|
||||
# os.environ["DJANGO_ENV"] = "dev"
|
||||
host = os.environ.get("UVICORN_HOST", "0.0.0.0")
|
||||
port = int(os.environ.get("UVICORN_PORT", 8000))
|
||||
workers = int(os.environ.get("UVICORN_WORKERS", 2))
|
||||
|
||||
Reference in New Issue
Block a user