修复登录任务无限重试导致文件描述符耗尽问题

1. docker-compose.yml:增加文件描述符限制 ulimits (65536)
2. login_service.py:限制最大重试次数为 10 次,避免无限重试
3. 解决 [Errno 24] Too many open files 错误
This commit is contained in:
yml2213
2026-06-25 06:58:18 +08:00
parent a4b04e7733
commit b9481d49ee
2 changed files with 8 additions and 1 deletions
+5
View File
@@ -26,6 +26,11 @@ services:
- MAIL_ROUNDCUBE_URL=${MAIL_ROUNDCUBE_URL:-}
# Uvicorn reload(生产环境保持 false
- UVICORN_RELOAD=${UVICORN_RELOAD:-false}
# 增加文件描述符限制,避免 "Too many open files" 错误
ulimits:
nofile:
soft: 65536
hard: 65536
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/health')"]
interval: 30s