diff --git a/ai/views/oj.py b/ai/views/oj.py index eea18c2..dc0117b 100644 --- a/ai/views/oj.py +++ b/ai/views/oj.py @@ -219,6 +219,13 @@ class AIDetailDataAPI(APIView): end = request.GET.get("end") username = request.GET.get("username") + if not start or not end: + return self.error("参数 start 和 end 不能为空") + if not parse_datetime(start): + return self.error("start 格式无效,请使用 ISO 8601 格式") + if not parse_datetime(end): + return self.error("end 格式无效,请使用 ISO 8601 格式") + user = request.user if username and request.user.is_super_admin(): try: diff --git a/flowchart/tasks.py b/flowchart/tasks.py index 98b4f38..071ea01 100644 --- a/flowchart/tasks.py +++ b/flowchart/tasks.py @@ -1,7 +1,10 @@ import json +import logging import time import dramatiq + +logger = logging.getLogger(__name__) from django.db import transaction from django.utils import timezone @@ -96,6 +99,7 @@ def evaluate_flowchart_task(submission_id): ) except Exception as e: + logger.exception("evaluate_flowchart_task failed for submission %s", submission_id) if submission is not None: submission.status = FlowchartSubmissionStatus.FAILED submission.save() diff --git a/oj/production_settings.py b/oj/production_settings.py index d6786e1..467b35b 100644 --- a/oj/production_settings.py +++ b/oj/production_settings.py @@ -16,7 +16,7 @@ REDIS_CONF = { "port": get_env("REDIS_PORT", "6379"), } -DEBUG = True +DEBUG = False ALLOWED_HOSTS = ["*"]