rpc 通信和判题初步测试通过;判题服务器不再依赖 redis 和 mysql。
This commit is contained in:
@@ -2,15 +2,15 @@
|
||||
import redis
|
||||
import datetime
|
||||
from rest_framework.views import APIView
|
||||
from judge.judger.result import result
|
||||
from judge.judger_controller.settings import redis_config
|
||||
from judge.result import result
|
||||
from django.conf import settings
|
||||
from utils.shortcuts import success_response
|
||||
from submission.models import Submission
|
||||
|
||||
|
||||
class QueueLengthMonitorAPIView(APIView):
|
||||
def get(self, request):
|
||||
r = redis.Redis(host=redis_config["host"], port=redis_config["port"], db=redis_config["db"])
|
||||
r = redis.Redis(host=settings.redis_config["host"], port=settings.redis_config["port"], db=settings.redis_config["db"])
|
||||
waiting_number = r.get("judge_queue_length")
|
||||
if waiting_number is None:
|
||||
waiting_number = 0
|
||||
|
||||
Reference in New Issue
Block a user