-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backend python code #4
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,76 @@ | |||
""" | |||
dispatcherFunc.py | |||
This file provides related functions for dispatcher.php. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean dispatcher.py
?
import time | ||
import logging | ||
import subprocess, sys | ||
logging.basicConfig(filename = 'dispatcher.log', level = logging.INFO, format = '%(asctime)s ::%(message)s',datafmt = '%m/%d/%Y %I:%M:%S %p') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One coding convention is at most 80 characters in one line,
thanks~
Simply comment at first round. |
logging.info('get idleMachine') | ||
while(idleMachine == None): | ||
idleMachine = getIdleMachine() | ||
time.sleep(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
time.sleep(1) should be front of idleMachine = getIdleMachine()
modify dispatcher.py. Not done
modify dispatcherFunc.py
do not connect to DB every time in while true loop |
logging.info('send info to other judge') | ||
arg = judgeLanguage + " " + pid + " " + judgeURL + " " + sid | ||
|
||
if os.path.exists("/var/nthuoj/outsideConnection/sendToOtherJudge.sh"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use config
Fine with other code |
the code is in ojbackend directory