File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
src/dstack/_internal/cli/commands Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 11import argparse
22import os
3+ from pathlib import Path
4+ from typing import Optional
35
46from dstack ._internal import settings
57from dstack ._internal .cli .commands import BaseCommand
@@ -81,11 +83,21 @@ def _command(self, args: argparse.Namespace):
8183 uvicorn_log_level = os .getenv ("DSTACK_SERVER_UVICORN_LOG_LEVEL" , "ERROR" ).lower ()
8284 reload_disabled = os .getenv ("DSTACK_SERVER_RELOAD_DISABLED" ) is not None
8385
86+ reload = settings .DSTACK_VERSION is None and not reload_disabled
87+ reload_excludes : Optional [list [str ]] = None
88+ if reload :
89+ # Don't reload on dstack._internal.cli package changes
90+ for parent in Path (__file__ ).parents :
91+ if parent .name == "cli" :
92+ reload_excludes = [str (parent )]
93+ break
94+
8495 uvicorn .run ( # type: ignore[unbound-variable]
8596 "dstack._internal.server.main:app" ,
8697 host = args .host ,
8798 port = args .port ,
88- reload = settings .DSTACK_VERSION is None and not reload_disabled ,
99+ reload = reload ,
100+ reload_excludes = reload_excludes ,
89101 log_level = uvicorn_log_level ,
90102 workers = 1 ,
91103 )
You can’t perform that action at this time.
0 commit comments