This commit is contained in:
@@ -42,7 +42,6 @@ func ListenFunc(ctx g.Ctx) {
|
||||
time.Sleep(retryDelay)
|
||||
continue
|
||||
}
|
||||
cool.Logger.Info(ctx, "成功获取 Redis 连接")
|
||||
|
||||
// 2. 启动心跳保活协程,防止连接因空闲被断开
|
||||
heartbeatCtx, heartbeatCancel := context.WithCancel(context.Background())
|
||||
@@ -67,7 +66,7 @@ func ListenFunc(ctx g.Ctx) {
|
||||
_ = conn.Close(ctx)
|
||||
return
|
||||
}
|
||||
cool.Logger.Debug(ctx, "Redis 心跳发送成功,连接正常")
|
||||
|
||||
}
|
||||
}
|
||||
}()
|
||||
@@ -170,7 +169,6 @@ func ListenFight(ctx g.Ctx) {
|
||||
time.Sleep(retryDelay)
|
||||
continue
|
||||
}
|
||||
cool.Logger.Info(ctx, "成功获取 Redis 连接")
|
||||
|
||||
// 2. 启动心跳保活协程(完全对齐 ListenFunc 逻辑)
|
||||
heartbeatCtx, heartbeatCancel := context.WithCancel(context.Background())
|
||||
|
||||
Reference in New Issue
Block a user