Skip to content

Commit ed1faa9

Browse files
committed
Feat: added server no reloader mode
1 parent d6d94f3 commit ed1faa9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ForrestHub-app/run.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ def run_flask(config: object | str, host="0.0.0.0", port=4444):
3939
@click.option('--host', help='Host address to bind the server')
4040
@click.option('--host-qr', help='Host address shown in QR code in Admin panel')
4141
@click.option('--version', is_flag=True, help='Show the version from setup.py')
42-
def main(port, host, host_qr, version):
42+
@click.option('--server', is_flag=True, help='Run without reloader mode')
43+
def main(port, host, host_qr, version, server):
4344
config = Config()
4445
logger = setup_logging(config.EXECUTABLE_DIR, config.LOG_FOLDER)
4546
logging.basicConfig(level=logging.INFO)
@@ -59,6 +60,9 @@ def main(port, host, host_qr, version):
5960
config.HOST_QR = host_qr
6061
config.HOST_QR_READABLE = get_readable_ip(config.HOST, config.PORT, config.HOST_QR)
6162

63+
if server:
64+
config.USE_RELOADER = False
65+
6266
if not is_port_free(config.HOST, config.PORT):
6367
new_port = find_free_port(config.HOST, 4444)
6468
logger.warning(f"Port {config.PORT} je již používán, přepínám na další dostupný port: {new_port}")

0 commit comments

Comments
 (0)