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