persist match informtion in DB

This commit is contained in:
2026-11-09 22:07:37 +03:00
parent f48094cd55
commit f0616c7c51
4 changed files with 43 additions and 2 deletions
+1
View File
@@ -130,6 +130,7 @@ $$| \text{rating}_A - \text{rating}_B | \le \text{tolerance}\big(\min(t_{\text{s
1. **Генерация идентификаторов и токенов в Ruby:**
- Генерируется уникальный UUID матча: `match_id = SecureRandom.uuid`.
- Создаётся запись о матче в БД (`matches`) с `uuid = match_id`, статусом `ongoing`, `game_server`, `started_at` и рейтингами игроков на момент подбора (`player1_rating_before` / `player2_rating_before`, изменения пока `0`). Если запись создать не удаётся, финализация в Redis не выполняется: игроки остаются в `mm:pending` и через `pending_ttl` возвращаются в очередь свипом.
- Генерируется JWT-токен для `game-server`:
```ruby
JwtService.encode(