fix: 修复 TieredManager 创建 session 时 L1/L2 ID 不一致导致 Redis 写入失败的问题
This commit is contained in:
@@ -127,9 +127,9 @@ func (m *TieredManager) Create(ctx context.Context, userID string, config models
|
||||
return "", err
|
||||
}
|
||||
|
||||
// L2: Redis(同步)
|
||||
// L2: Redis(同步),使用 L1 生成的 ID 保证一致性
|
||||
if m.isRedisOK() {
|
||||
if _, err := m.l2.Create(ctx, userID, config); err != nil {
|
||||
if _, err := m.l2.CreateWithID(ctx, id, userID, config); err != nil {
|
||||
logger.Log.Warnw("Redis Create failed, continuing without L2",
|
||||
"session", id, "error", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user