feat(auth): upgrade casbin to v3 and enhance connection pool configurations
Some checks failed
Build / build (push) Successful in 2m23s
Build / build-docker (push) Failing after 1m37s

- Upgrade casbin from v2 to v3 across go.mod and pkg/auth/casbin.go
- Add slide captcha verification to registration flow (CheckVerified, ConsumeVerified)
- Add DB wrapper with connection pool statistics and health checks
- Add Redis connection pool optimizations with stats and health monitoring
- Add new config options: ConnMaxLifetime, HealthCheckInterval, EnableRetryOnError
- Optimize slow query threshold from 200ms to 100ms
- Add ping with retry mechanism for database and Redis connections
This commit is contained in:
2026-02-25 19:00:50 +08:00
parent 1da0ee1ed1
commit a111872b32
15 changed files with 534 additions and 93 deletions

View File

@@ -86,8 +86,8 @@ func checkRedis(ctx context.Context) error {
return errors.New("Redis客户端未初始化")
}
// 使用Ping检查连接
if err := client.Ping(ctx).Err(); err != nil {
// 使用Ping检查连接封装后的方法直接返回error
if err := client.Ping(ctx); err != nil {
return err
}