mirror of
https://github.com/QingdaoU/JudgeServer.git
synced 2025-01-01 13:58:16 +00:00
完善服务发现
This commit is contained in:
parent
fe115969b0
commit
2884f7bf5a
@ -10,7 +10,6 @@ RUN echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-se
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y oracle-java7-installer
|
||||
RUN cd /tmp && git clone https://github.com/QingdaoU/Judger && cd Judger && git checkout newnew && mkdir build && cd build && cmake .. && make && make install && cd ../bindings/Python && python setup.py install
|
||||
RUN mkdir /var/wp
|
||||
RUN pip install psutil gunicorn web.py requests
|
||||
RUN mkdir -p /judger_run /test_case /log /code
|
||||
COPY deploy/java_policy /etc
|
||||
|
14
service.py
14
service.py
@ -45,21 +45,11 @@ class JudgeService(object):
|
||||
if r["err"]:
|
||||
raise JudgeServiceError(r["data"])
|
||||
|
||||
def register(self):
|
||||
data = server_info()
|
||||
data["action"] = "register"
|
||||
data["service_host"] = self.service_host
|
||||
data["service_port"] = self.service_port
|
||||
self._request(data)
|
||||
|
||||
def unregister(self):
|
||||
data = server_info()
|
||||
data["action"] = "unregister"
|
||||
self._request(data)
|
||||
|
||||
def heartbeat(self):
|
||||
data = server_info()
|
||||
data["action"] = "heartbeat"
|
||||
data["service_host"] = self.service_host
|
||||
data["service_port"] = self.service_port
|
||||
self._request(data)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user