Skip to content
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

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

backend python code #4

wants to merge 20 commits into from

Conversation

shawn1128
Copy link

the code is in ojbackend directory

@@ -0,0 +1,76 @@
"""
dispatcherFunc.py
This file provides related functions for dispatcher.php.

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')
Copy link
Contributor

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~

@bruce3557
Copy link
Contributor

Simply comment at first round.
If any idea we can discussion.
Great job!

logging.info('get idleMachine')
while(idleMachine == None):
idleMachine = getIdleMachine()
time.sleep(1)
Copy link
Contributor

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
@CHIAHSINHOU
Copy link
Contributor

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"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use config

@bruce3557
Copy link
Contributor

Fine with other code
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants