-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat(webserver): implement new storage layer for repository meta #1750
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1750 +/- ##
==========================================
- Coverage 53.71% 53.17% -0.54%
==========================================
Files 115 116 +1
Lines 9928 9976 +48
==========================================
- Hits 5333 5305 -28
- Misses 4595 4671 +76 ☔ View full report in Codecov by Sentry. |
71faf5b
to
51d5512
Compare
28c788f
to
f6dce73
Compare
2b579c3
to
323a3c7
Compare
let mut repository_lookup = self.repository_lookup.write().unwrap(); | ||
debug!("Reloading repositoriy metadata..."); | ||
*repository_lookup = load_meta(new_repositories); | ||
pub fn latest_version(&self) -> Result<u64> { |
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.
pub fn latest_version(&self) -> Result<u64> { | |
fn latest_version(&self) -> Result<u64> { |
let bucket: Bucket<_, String> = self.cache.bucket(Some(META_BUCKET))?; | ||
if !bucket.contains(&META_BUCKET_VERSION_KEY.to_string())? { | ||
self.update_latest_version(self.get_next_version()?)?; | ||
} |
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.
let bucket: Bucket<_, String> = self.cache.bucket(Some(META_BUCKET))?; | |
if !bucket.contains(&META_BUCKET_VERSION_KEY.to_string())? { | |
self.update_latest_version(self.get_next_version()?)?; | |
} |
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.
if there's no latest version, it means the storage is simply empty.
type RepositoryBucket<'a> = Bucket<'a, String, kv::Json<RepositoryMeta>>; | ||
|
||
static META_BUCKET: &str = "meta"; | ||
static META_BUCKET_VERSION_KEY: &str = "version"; | ||
|
||
impl RepositoryCache { |
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.
please review visibility of functions in this struct.
Relates to TAB-533