-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add flag to skip clean objects #11
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR! I added some comments.
common.py
Outdated
@@ -43,6 +43,7 @@ | |||
|
|||
AV_DEFINITION_FILE_PREFIXES = ["main", "daily", "bytecode"] | |||
AV_DEFINITION_FILE_SUFFIXES = ["cld", "cvd"] | |||
AV_SKIP_CLEAN_OBJECTS = os.getenv("AV_SKIP_CLEAN_OBJECTS", "False") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AV_SKIP_CLEAN_OBJECTS = os.getenv("AV_SKIP_CLEAN_OBJECTS", "False") | |
AV_SKIP_CLEAN_OBJECTS = int(os.getenv("AV_SKIP_CLEAN_OBJECTS", "0")) |
"False"
is truthy. This should make it more difficult to accidentally set a truthy value. I'm definitely open to other approaches though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In python, str_to_bool
isn't a built-in. Where are you getting that defined?
Co-authored-by: Ryan Delaney <[email protected]>
Tests please? :) @cuchi |
This change adds a flag
AV_SKIP_CLEAN_OBJECTS
that allows us to skip objects that are guaranteed to be clean (i.e. server-generated files). This flag is disabled by default, so it won't disrupt any existing behavior.If the flag is enabled, it will skip the scan for every file that has the metadata
av-status
:CLEAN
.