Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/aiida/cmdline/commands/cmd_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ def start(foreground, number, timeout):
Returns exit code 0 if the daemon is OK, non-zero if there was an error.
"""
echo.echo(f'Starting the daemon with {number} workers... ', nl=False)
execute_client_command('start_daemon', number_workers=number, foreground=foreground, timeout=timeout)
from aiida.engine.daemon.daemon import AiidaDaemon
# TODO foreground, timeout param
AiidaDaemon().start(number, foreground)


@verdi_daemon.command()
Expand All @@ -105,6 +107,10 @@ def status(ctx, all_profiles, timeout):

Returns exit code 0 if all requested daemons are running, else exit code 3.
"""
from aiida.engine.daemon.daemon import AiidaDaemon
# TODO foreground, timeout param
AiidaDaemon().status()
return
from tabulate import tabulate

from aiida.cmdline.utils.common import format_local_time
Expand Down Expand Up @@ -206,6 +212,9 @@ def stop(ctx, no_wait, all_profiles, timeout):

Returns exit code 0 if the daemon was shut down successfully (or was not running), non-zero if there was an error.
"""
from aiida.engine.daemon.daemon import AiidaDaemon
# TODO no-wait, timeout

if all_profiles is True:
profiles = [profile for profile in ctx.obj.config.profiles if not profile.is_test_profile]
else:
Expand All @@ -215,6 +224,7 @@ def stop(ctx, no_wait, all_profiles, timeout):
echo.echo('Profile: ', fg=echo.COLORS['report'], bold=True, nl=False)
echo.echo(f'{profile.name}', bold=True)
echo.echo('Stopping the daemon... ', nl=False)
AiidaDaemon(profile).stop()
execute_client_command('stop_daemon', daemon_not_running_ok=True, wait=not no_wait, timeout=timeout)


Expand Down
Loading
Loading