-
-
Notifications
You must be signed in to change notification settings - Fork 754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FileNotFoundError
on files on reload-exclude
#1785
Comments
yes, notify, and therefore watchfiles doesn't allow you to exclude a directory, just select multiple directories to watch. |
If I wrap the following line on File "/opt/app-env/lib/python3.8/site-packages/uvicorn/supervisors/watchfilesreload.py", line 85, in should_restart
changes = next(self.watcher) Would it be a bad idea? How do you think we should solve this? 🤔 |
I thought about that, but I think the rust code will exit early if it finds an error, so you might miss changes. I haven't checked, that's just my guess. |
you might also ignore other errors, not just permission denied. |
Can I interpret the above as "on uvicorn, we should instead wait for samuelcolvin/watchfiles#147, and then change the behavior to 'ignore these errors'"? |
yes. |
Thanks 🙏 |
I resolved this problem by typing this command in my terminal |
@Kludex I have merged samuelcolvin/watchfiles#147 |
You can just set the env variable. I think that's enough for now. |
@samuelcolvin could you refer me to which env variable you are talking? I am currently experiencing the same problem of a sub directory having restricted permissions and crashing the For replication: pip install uvicorn[standard]
version: '3'
services:
db:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: mydatabase
MYSQL_USER: user
MYSQL_PASSWORD: password
volumes:
- ./db:/var/lib/mysql and start with uvicorn api.main:app --reload --port 3000 --reload-dir api --reload-exclude 'db/**/*' But this results in original posted |
A similar problem happen when I am not entirely sure whether watching ALL files and then ignore is a reasonable solution. Took me quite some time wondering how is it even possible that error comes from a folder which definitely should be ignored until I looked into the |
When I use
--reload-exclude
, or another directory is supposed to be watched, I still have the following:The command used was:
I guess it's because we don't really exclude, we just check the path to see if we should reload.
cc @samuelcolvin
Important
The text was updated successfully, but these errors were encountered: