def execute(self):
info = ReportingServerManager.get_current_server_info()
if not info:
print("No server found.", file=sys.stderr)
// There should only be one pidfile, but in case there are many, we kill them all here.
for pidfile, pid, port in info:
with open(pidfile, "r") as infile:
pidstr = infile.read()
After Change
try:
logger.info("Killing server with {pid} at http://localhost:{port}"
.format(pid=pid, port=server.socket))
server.terminate()
except ReportingServerManager.NonResponsiveProcess:
logger.info("Failed to kill server with pid {pid}!".format(pid=pid))