[cli] run does not reload modules by default

This commit is contained in:
Maxime Alves LIRMM@home 2021-10-04 20:11:32 +02:00
parent 55109e271c
commit f3c12f516e
1 changed files with 6 additions and 2 deletions

View File

@ -14,8 +14,9 @@ from ..conf import (PROJECT_NAME, HOST, PORT,
@click.option('--host', default=None) @click.option('--host', default=None)
@click.option('--port', default=None) @click.option('--port', default=None)
@click.option('--reload', default=False)
@cli.command() @cli.command()
def run(host, port): def run(host, port, reload):
""" """
The "halfapi run" command The "halfapi run" command
""" """
@ -28,7 +29,10 @@ def run(host, port):
port = int(port) port = int(port)
reload = not PRODUCTION if PRODUCTION:
reload = False
raise Exception('Can\'t use live code reload in production')
log_level = 'info' if PRODUCTION else LOGLEVEL log_level = 'info' if PRODUCTION else LOGLEVEL
click.echo(f'Launching application {PROJECT_NAME}') click.echo(f'Launching application {PROJECT_NAME}')