mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05:00
Quick Fix for Killing Ray Notebooks (#1563)
This commit is contained in:
parent
ab37d0cd19
commit
73be235701
1 changed files with 8 additions and 2 deletions
|
@ -238,8 +238,14 @@ def stop():
|
|||
"awk '{ print $2 }') 2> /dev/null"], shell=True)
|
||||
|
||||
# Find the PID of the jupyter process and kill it.
|
||||
subprocess.call(["kill $(ps aux | grep jupyter | grep -v grep | "
|
||||
"awk '{ print $2 }') 2> /dev/null"], shell=True)
|
||||
try:
|
||||
from notebook.notebookapp import list_running_servers
|
||||
pids = [str(server["pid"]) for server in list_running_servers()
|
||||
if "/tmp/raylogs" in server["notebook_dir"]]
|
||||
subprocess.call(["kill {} 2> /dev/null".format(
|
||||
" ".join(pids))], shell=True)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
@click.command()
|
||||
|
|
Loading…
Add table
Reference in a new issue