Skip to content

Commit

Permalink
fix: try create occupancy key to exsting rooms
Browse files Browse the repository at this point in the history
  • Loading branch information
reinaldooli committed Feb 27, 2025
1 parent ccb4fba commit 26befc4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/adapters/storage/redis/room/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ func (r redisStateStorage) GetRoom(ctx context.Context, scheduler, roomID string
SchedulerID: scheduler,
}

p := r.client.Pipeline()
roomHashCmd := r.client.HGetAll(ctx, getRoomRedisKey(room.SchedulerID, room.ID))

p := r.client.Pipeline()
_ = p.ZAddNX(ctx, getRoomOccupancyRedisKey(room.SchedulerID), &redis.Z{Member: room.ID, Score: float64(room.RunningMatches)})
statusCmd := p.ZScore(ctx, getRoomStatusSetRedisKey(room.SchedulerID), room.ID)
pingCmd := p.ZScore(ctx, getRoomPingRedisKey(room.SchedulerID), room.ID)
occupancyCmd := p.ZScore(ctx, getRoomOccupancyRedisKey(room.SchedulerID), room.ID)
Expand Down

0 comments on commit 26befc4

Please sign in to comment.