Skip to content

Commit 190c413

Browse files
committed
fix: make scrimmages not tournament matches
1 parent 5f748af commit 190c413

3 files changed

Lines changed: 21 additions & 2 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 5.2.10 on 2026-02-03 03:45
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('games', '0034_match_is_ranked'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='game',
15+
name='is_scrimmage',
16+
field=models.BooleanField(default=False),
17+
),
18+
]

othello/apps/games/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ class Game(models.Model):
259259
score = models.IntegerField(default=0)
260260

261261
is_tournament = models.BooleanField(default=False)
262+
is_scrimmage = models.BooleanField(default=False)
262263
playing = models.BooleanField(default=False)
263264
last_heartbeat = models.DateTimeField(default=timezone.now)
264265

othello/apps/games/tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def send_through_game_channel(game: Game, event_type: str, object_id: int) -> in
2626

2727

2828
def check_heartbeat(game: Game) -> bool:
29-
if game.is_tournament:
29+
if game.is_tournament or game.is_scrimmage:
3030
return True
3131
game.refresh_from_db()
3232
return (timezone.now() - game.last_heartbeat).seconds < settings.CLIENT_HEARTBEAT_INTERVAL * 2
@@ -233,7 +233,7 @@ def run_match(match_id: int) -> str | None:
233233
match=match,
234234
time_limit=5,
235235
playing=True,
236-
is_tournament=True,
236+
is_scrimmage=True,
237237
last_heartbeat=timezone.now(),
238238
)
239239
games.append(game)

0 commit comments

Comments
 (0)