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

chore: shrink listing file to speed download times #347

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions manager/src/grype_db_manager/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
from collections.abc import Generator

DB_SUFFIXES = {".tar.gz", ".tar.zst"}
MAX_DB_AGE = 120 # ~4 months in days
MINIMUM_DB_COUNT = MAX_DB_AGE # number of db entries per schema
MAX_DB_AGE = 7 # old db listings are making the file large and slowing download times
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My vote is to make this 2, which would support what I think are the main use cases:

  • get the latest
  • see what's changed in the latest

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I'll do that and also figure out why unit tests are failing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went with 3 because it prevents having to rewrite a test fixture. Do you think it's important to push for 2 @kzantow?

MINIMUM_DB_COUNT = 2 # always include at least 2 databases, no matter how old


def listing_entries_dbs_in_s3(
Expand Down
Loading