mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 22:37:10 +00:00
Merge branch 'master' of https://gitlab.prodcontest.ru/team-15/project
This commit is contained in:
@@ -9,7 +9,7 @@ from django.utils import timezone
|
||||
|
||||
from apps.competition.models import Competition, State
|
||||
from apps.review.models import Reviewer
|
||||
from apps.task.models import CompetitionTask, CompetitionTaskSubmission
|
||||
from apps.task.models import CompetitionTask, CompetitionTaskSubmission, CompetitionTaskCriteria
|
||||
from apps.user.models import User, UserRole
|
||||
|
||||
|
||||
@@ -91,6 +91,8 @@ class Command(BaseCommand):
|
||||
tasks = []
|
||||
task_types = [
|
||||
CompetitionTask.CompetitionTaskType.INPUT.value,
|
||||
CompetitionTask.CompetitionTaskType.REVIEW.value,
|
||||
CompetitionTask.CompetitionTaskType.INPUT.value
|
||||
]
|
||||
for comp in competitions:
|
||||
# Create 3 tasks per competition
|
||||
@@ -108,6 +110,15 @@ class Command(BaseCommand):
|
||||
submission_reviewers_count=random.randint(2, 10),
|
||||
max_attempts=random.randint(1, 10),
|
||||
)
|
||||
if task_type == CompetitionTask.CompetitionTaskType.REVIEW.value:
|
||||
for j in range(5):
|
||||
CompetitionTaskCriteria.objects.create(
|
||||
task=task,
|
||||
name=f"Criteria_{j}",
|
||||
slug=f"criteria_{j}",
|
||||
description=f"Criteria description {j}",
|
||||
max_value=random.randint(1, 10),
|
||||
)
|
||||
tasks.append(task)
|
||||
self.stdout.write(f"Created task: {title} (type: {task_type})")
|
||||
self.add_reviewers_to_task(tasks)
|
||||
|
||||
@@ -11,7 +11,7 @@ class CheckerHealthCheck(BaseHealthCheckBackend):
|
||||
def check_status(self) -> None:
|
||||
try:
|
||||
response = httpx.get(
|
||||
f"{settings.CHECKER_API_ENDPOINT}/ping", timeout=1
|
||||
f"{settings.CHECKER_API_ENDPOINT}/health", timeout=10
|
||||
)
|
||||
if response.status_code >= status.INTERNAL_SERVER_ERROR:
|
||||
self.add_error("Checker service is unaccessible")
|
||||
|
||||
@@ -33,6 +33,6 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
EXPOSE 8080
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --start-interval=2s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:8000/ping || exit 1
|
||||
CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:8000/health || exit 1
|
||||
|
||||
CMD uvicorn main:app --host 0.0.0.0 --port 8000
|
||||
|
||||
Reference in New Issue
Block a user