mirror of
https://github.com/fawney19/Aether.git
synced 2026-01-03 16:22:27 +08:00
feat: 添加模型列表访问限制功能
实现 API Key 和 User 级别的模型访问权限控制,支持按 Provider 和模型名称限制。 - 新增 AccessRestrictions 类处理访问限制合并逻辑(API Key 优先于 User) - models_service 支持根据限制过滤模型列表 - models.py 在列表查询时构建并应用访问限制 - 优化缓存策略:仅无限制请求使用缓存,有限制的请求旁路缓存 - 修复 logger 配置:enqueue 改为 False 避免 macOS 信号量泄漏
This commit is contained in:
@@ -96,13 +96,15 @@ if not DISABLE_FILE_LOG:
|
||||
log_dir.mkdir(exist_ok=True)
|
||||
|
||||
# 文件日志通用配置
|
||||
# 注意: enqueue=False 使用同步模式,避免 multiprocessing 信号量泄漏
|
||||
# 在 macOS 上,进程异常退出时 POSIX 信号量不会自动释放,导致资源耗尽
|
||||
file_log_config = {
|
||||
"format": FILE_FORMAT,
|
||||
"filter": _log_filter,
|
||||
"rotation": "100 MB",
|
||||
"retention": "30 days",
|
||||
"compression": "gz",
|
||||
"enqueue": True,
|
||||
"enqueue": False,
|
||||
"encoding": "utf-8",
|
||||
"catch": True,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user