refactor: improve object listing and version handling

- Refactor find_version_index to accept Uuid directly instead of string
- Split from_meta_cache_entries_sorted into separate methods for versions and infos
- Add support for after_version_id filtering in version listing
- Fix S3 error code for replication configuration not found
- Improve error handling and logging levels
- Clean up import statements and remove debug code
This commit is contained in:
weisd
2025-06-24 11:10:23 +08:00
parent 364c3098b2
commit 7e17d7d729
10 changed files with 141 additions and 45 deletions
+1 -7
View File
@@ -461,13 +461,7 @@ pub struct FileInfoVersions {
}
impl FileInfoVersions {
pub fn find_version_index(&self, v: &str) -> Option<usize> {
if v.is_empty() {
return None;
}
let vid = Uuid::parse_str(v).unwrap_or_default();
pub fn find_version_index(&self, vid: Uuid) -> Option<usize> {
self.versions.iter().position(|v| v.version_id == Some(vid))
}