mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 02:47:10 +00:00
Merge branch 'master' of https://gitlab.prodcontest.ru/team-15/project
This commit is contained in:
+7
-1
@@ -376,10 +376,16 @@ services:
|
||||
context: ./services/checker
|
||||
dockerfile: Dockerfile
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- name: web
|
||||
target: 8000
|
||||
published: 8009
|
||||
host_ip: 0.0.0.0
|
||||
protocol: tcp
|
||||
volumes:
|
||||
- type: bind
|
||||
source: /var/run/docker.sock
|
||||
target: /prometheus
|
||||
target: /var/run/docker.sock
|
||||
|
||||
proxy:
|
||||
image: docker.io/nginx:1.27-alpine3.21
|
||||
|
||||
@@ -155,5 +155,5 @@ def get_submissions_history(request, competition_id: UUID, task_id: UUID):
|
||||
def get_task_attachments(request, competition_id: UUID, task_id: UUID):
|
||||
task = get_object_or_404(CompetitionTask, id=task_id)
|
||||
return status.OK, CompetitionTaskAttachment.objects.filter(
|
||||
competition_id=competition_id, task=task, user=request.auth
|
||||
)
|
||||
task=task
|
||||
).all()
|
||||
|
||||
@@ -5,3 +5,6 @@ class CoreConfig(AppConfig):
|
||||
name = "apps.review"
|
||||
label = "review"
|
||||
verbose_name = "Проверка"
|
||||
|
||||
def ready(self):
|
||||
import apps.review.signals
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
# myapp/signals.py
|
||||
from django.db.models.signals import m2m_changed
|
||||
from django.dispatch import receiver
|
||||
|
||||
from apps.review.models import Review
|
||||
from apps.task.models import CompetitionTask, CompetitionTaskSubmission
|
||||
|
||||
|
||||
@receiver(m2m_changed, sender=CompetitionTask.reviewers.through)
|
||||
def print_reviewers(sender, instance, action, **kwargs):
|
||||
if action in ['post_add', 'post_remove', 'post_clear']:
|
||||
submissions = CompetitionTaskSubmission.objects.filter(task=instance)
|
||||
for submission in submissions:
|
||||
submission.send_on_review()
|
||||
@@ -182,7 +182,7 @@ class CompetitionTaskSubmission(BaseModel):
|
||||
] # да это медленно работает и чо
|
||||
|
||||
for reviewer in reviewers:
|
||||
Review.objects.create(
|
||||
Review.objects.update_or_create(
|
||||
reviewer=reviewer,
|
||||
submission=self,
|
||||
)
|
||||
|
||||
@@ -11,7 +11,7 @@ class CheckerHealthCheck(BaseHealthCheckBackend):
|
||||
def check_status(self) -> None:
|
||||
try:
|
||||
response = httpx.get(
|
||||
f"{settings.ANTIFRAUD_ADDRESS}/ping", timeout=1
|
||||
f"{settings.CHECKER_API_ENDPOINT}/ping", timeout=1
|
||||
)
|
||||
if response.status_code >= status.INTERNAL_SERVER_ERROR:
|
||||
self.add_error("Checker service is unaccessible")
|
||||
|
||||
Reference in New Issue
Block a user