Skip to content

Commit

Permalink
Merge pull request #102 from chibiegg/feat/team_benchmark
Browse files Browse the repository at this point in the history
ベンチマークが指定されているチームのベンチマークは行わない
  • Loading branch information
chibiegg authored Sep 24, 2019
2 parents 739d8cc + 9c88b14 commit 6fe0aef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions isucon/portal/contest/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ def dequeue(self, benchmarker=None):
# 報告したベンチマーカの紐づいているチーム、かつWAITING状態のジョブを取得
queryset = self.get_queryset().select_for_update().filter(status=Job.WAITING, team__benchmarker=benchmarker)
else:
# ベンチマーカーがチーム気にせずベンチマークを行う場合
queryset = self.get_queryset().select_for_update().filter(status=Job.WAITING)
# ベンチマーカーが割り当てられてないチームのベンチマークを行う場合
queryset = self.get_queryset().select_for_update().filter(status=Job.WAITING, team__benchmarker__isnull=True)

job = queryset.order_by("created_at").first()
if job is None:
Expand Down

0 comments on commit 6fe0aef

Please sign in to comment.