Skip to content
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

Added --reload-exclude-dir param #1013

Closed
wants to merge 1 commit into from
Closed

Conversation

Aragroth
Copy link


New CLI feature

New --reload-exclude-dir parameter for uvicorn-CLI allows to exclude folder from being watched by reloader. As a --reload-dir param, it can be specified multiple times.

Purpose

The idea was already described in #984. I would also mention, that WatchGod (which is used by default) reloads project even if changes were made not only to source code (Unlike Statreload). So when you have a folder with static files and user uploads image, the project gets reloaded. And adding lots of folders with param --reload-dir, instead of just excluding one folder, can be really annoying.

Working mechanism

I thought, that idea of pattern matching is not the best. Also it would be better for both of reloaders to have same excluding mechanism. So, I just compare absolute paths of files. You can not specify both included and excluded folders. Also added a few tests for this param.

@robbymeals
Copy link

Strongly support this feature addition! 🙏 🥺

@117503445
Copy link

I also want this feature 🙏

@dusty-phillips
Copy link

I'm happy to rebase this and fix the conflicts if I can get some confirmation from the devs that it will be merged.

@Kludex
Copy link
Sponsor Member

Kludex commented Jul 9, 2021

Hey @dusty-phillips !
Our thoughts are on this comment and on the next one.

This PR has less priority than the #820, but we are not definitive yet. I really appreciate your intentions, but I'd recommend to not lose time rebasing right now.

@Kludex
Copy link
Sponsor Member

Kludex commented Sep 22, 2021

#820 was merged. Closing this PR.

@Aragroth thanks for the efforts!

@Kludex Kludex closed this Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants