Private
Public Access
1
0

重构:文件系统模块化架构,优化应用启动流程

This commit is contained in:
2026-01-28 00:28:54 +08:00
parent 4a9b25a505
commit 8c577f70e7
123 changed files with 32030 additions and 967 deletions

View File

@@ -5,8 +5,8 @@ import (
"encoding/json"
"fmt"
"sync"
"time"
"go-desk/internal/common"
"go-desk/internal/crypto"
"go-desk/internal/storage/models"
)
@@ -84,7 +84,7 @@ func (p *ConnectionPool) GetRedisClient(conn *models.DbConnection) (*RedisClient
// 检查是否已存在
if client, ok := p.redisClients[conn.ID]; ok {
// 测试连接是否有效
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), common.TimeoutPing)
defer cancel()
if err := client.client.Ping(ctx).Err(); err == nil {
return client, nil
@@ -140,7 +140,7 @@ func (p *ConnectionPool) GetMongoClient(conn *models.DbConnection) (*MongoClient
// 检查是否已存在
if client, ok := p.mongoClients[conn.ID]; ok {
// 测试连接是否有效
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), common.TimeoutPing)
defer cancel()
if err := client.client.Ping(ctx, nil); err == nil {
return client, nil