mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2024-12-28 16:12:13 +00:00
migrate health_check.py to python3
This commit is contained in:
parent
cef608b809
commit
040fb6fbbd
@ -1,8 +1,8 @@
|
||||
import xmlrpclib
|
||||
import xmlrpc.client
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
server = xmlrpclib.Server("http://localhost:9005/RPC2")
|
||||
with xmlrpc.client.ServerProxy("http://localhost:9005/RPC2") as server:
|
||||
info = server.supervisor.getAllProcessInfo()
|
||||
error_states = list(filter(lambda x: x["state"] != 20, info))
|
||||
exit(len(error_states))
|
||||
|
Loading…
Reference in New Issue
Block a user