Skip to content

Commit

Permalink
remove stale daemon pid in status check
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Jul 3, 2019
1 parent e232f94 commit 3677b18
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 3677b18

Please sign in to comment.