Is it somehow possible to exclude certain part of the code when reloading the scrip with --reload
flag?
uvicorn main:app --reload
Use case: I have a model which takes a lot of time loading so I was wondering if there is a way to ignore that line of code when reloading. Or is it just impossible?
Update
Uvicorn now supports including/excluding certain directories/files to/from watchlist.
No there is no way to exclude something, however you can be explicit in what you want to be looked at with the
--reload-dir
flag:in https://www.uvicorn.org/#command-line-options