def stop_server(config): """Stop the Konduit server associated with a given config file.""" from konduit.server import stop_server_by_pid from konduit.load import pop_pid pid = pop_pid(config) stop_server_by_pid(pid) logging.info(">>> Stopped running Konduit server with PID " + str(pid))
def test_pid_creation_removal(): file_path = "yaml/konduit.yaml" running_server = server_from_file(file_path, start_server=True) # store the pid of this server and forget the Python object pid = running_server.process.pid store_pid(file_path=file_path, pid=running_server.process.pid) del running_server # retrieve the pid internally and kill the process recov_pid = pop_pid(file_path=file_path) assert pid == recov_pid stop_server_by_pid(recov_pid)
def stop_server(pid): """Stop the Konduit server associated with a given config file.""" from konduit.server import stop_server_by_pid stop_server_by_pid(pid) logging.info(">>> Stopped running Konduit server at PID " + str(pid))