File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -104,19 +104,19 @@ impl RecentlyAccessedReleases {
104104 let mut five_minute_count = 0 ;
105105 map. retain ( |_, instant| {
106106 let elapsed = instant. elapsed ( ) ;
107- if elapsed > Duration :: from_secs ( 60 * 60 ) {
108- return false ;
107+
108+ if elapsed < Duration :: from_secs ( 60 * 60 ) {
109+ hour_count += 1 ;
109110 }
110- hour_count += 1 ;
111- if elapsed > Duration :: from_secs ( 30 * 60 ) {
112- return true ;
111+ if elapsed < Duration :: from_secs ( 30 * 60 ) {
112+ half_hour_count += 1 ;
113113 }
114- half_hour_count += 1 ;
115- if elapsed > Duration :: from_secs ( 5 * 60 ) {
116- return true ;
114+ if elapsed < Duration :: from_secs ( 5 * 60 ) {
115+ five_minute_count += 1 ;
117116 }
118- five_minute_count += 1 ;
119- true
117+
118+ // Only retain items accessed within the last hour
119+ return elapsed < Duration :: from_secs ( 60 * 60 ) ;
120120 } ) ;
121121
122122 metric. with_label_values ( & [ "one hour" ] ) . set ( hour_count) ;
You can’t perform that action at this time.
0 commit comments