mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-01-01 10:02:01 +00:00
Merge branch 'zemal_dev' into chiaki_dev
* zemal_dev: Test redis in travis-ci
This commit is contained in:
commit
ce7161552f
@ -2,6 +2,7 @@ language: python
|
||||
python:
|
||||
- "3.5"
|
||||
install:
|
||||
- sudo apt-get install -qq redis-server && redis-server &
|
||||
- pip install -r deploy/requirements.txt
|
||||
- mkdir log test_case upload
|
||||
- cp oj/custom_settings.example.py oj/custom_settings.py
|
||||
|
@ -1,11 +1,11 @@
|
||||
import hashlib
|
||||
|
||||
from django.utils import timezone
|
||||
# from django_redis import get_redis_connection
|
||||
from django_redis import get_redis_connection
|
||||
|
||||
from account.decorators import super_admin_required
|
||||
from judge.languages import languages, spj_languages
|
||||
# from judge.dispatcher import process_pending_task
|
||||
from judge.dispatcher import process_pending_task
|
||||
from utils.api import APIView, CSRFExemptAPIView, validate_serializer
|
||||
from utils.shortcuts import rand_str
|
||||
|
||||
@ -129,8 +129,8 @@ class JudgeServerHeartbeatAPI(CSRFExemptAPIView):
|
||||
last_heartbeat=timezone.now(),
|
||||
)
|
||||
# 新server上线 处理队列中的,防止没有新的提交而导致一直waiting
|
||||
# conn = get_redis_connection("JudgeQueue")
|
||||
# process_pending_task(conn)
|
||||
conn = get_redis_connection("JudgeQueue")
|
||||
process_pending_task(conn)
|
||||
|
||||
return self.success()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user