Skip to content

Commit

Permalink
Remove stale daemon pid in status checks (aiidateam#3118)
Browse files Browse the repository at this point in the history
Added stale pid removal to `verdi status` and `verdi daemon status`
  • Loading branch information
unkcpz authored and d-tomerini committed Sep 30, 2019
1 parent 73cf592 commit 5e28d73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions aiida/cmdline/commands/cmd_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def status(all_profiles):

for profile in profiles:
client = get_daemon_client(profile.name)
delete_stale_pid_file(client)
click.secho('Profile: ', fg='red', bold=True, nl=False)
click.secho('{}'.format(profile.name), bold=True)
result = get_daemon_status(client)
Expand Down
3 changes: 2 additions & 1 deletion aiida/cmdline/commands/cmd_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ServiceStatus(IntEnum):
def verdi_status():
"""Print status of AiiDA services."""
# pylint: disable=broad-except,too-many-statements
from aiida.cmdline.utils.daemon import get_daemon_status
from aiida.cmdline.utils.daemon import get_daemon_status, delete_stale_pid_file
from aiida.common.utils import Capturing, get_repository_folder
from aiida.manage.external.rmq import get_rmq_url
from aiida.manage.manager import get_manager
Expand Down Expand Up @@ -101,6 +101,7 @@ def verdi_status():
# getting the daemon status
try:
client = manager.get_daemon_client()
delete_stale_pid_file(client)
daemon_status = get_daemon_status(client)

daemon_status = daemon_status.split('\n')[0] # take only the first line
Expand Down

0 comments on commit 5e28d73

Please sign in to comment.