@@ -75,7 +75,7 @@ impl Meta {
7575 Ok ( ( ) )
7676 }
7777
78- /// Updates the active version and removes versions rejected by age or generation limits.
78+ /// Updates the active version and removes versions rejected by age or version limits.
7979 ///
8080 /// Returns `(removed_versions, next_check_time)`.
8181 /// - `removed_versions`: version directories that should be deleted.
@@ -84,7 +84,7 @@ impl Meta {
8484 & mut self ,
8585 active_version : & str ,
8686 expire_seconds : u64 ,
87- max_generations : u32 ,
87+ max_versions : u32 ,
8888 versions : & [ String ] ,
8989 ) -> Result < ( Vec < String > , u64 ) > {
9090 let now = Self :: current_timestamp ( ) ;
@@ -110,9 +110,9 @@ impl Meta {
110110 } ) ;
111111 }
112112
113- if max_generations != 0 {
113+ if max_versions != 0 {
114114 // `versions` is already scoped to the current storage directory, so every
115- // non-hidden, non-active entry is a generation candidate.
115+ // non-hidden, non-active entry is a version candidate.
116116 let mut candidates = versions
117117 . iter ( )
118118 . filter ( |version| version. as_str ( ) != active_version && !version. starts_with ( [ '_' , '.' ] ) )
@@ -123,10 +123,8 @@ impl Meta {
123123 )
124124 } )
125125 . collect :: < Vec < _ > > ( ) ;
126- let retained_inactive_generations = max_generations. saturating_sub ( 1 ) as usize ;
127- let remove_count = candidates
128- . len ( )
129- . saturating_sub ( retained_inactive_generations) ;
126+ let retained_inactive_versions = max_versions. saturating_sub ( 1 ) as usize ;
127+ let remove_count = candidates. len ( ) . saturating_sub ( retained_inactive_versions) ;
130128 candidates. sort_unstable_by ( |( version_a, timestamp_a) , ( version_b, timestamp_b) | {
131129 timestamp_a
132130 . cmp ( timestamp_b)
0 commit comments