File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -91,10 +91,11 @@ impl RecentlyAccessedReleases {
91
91
}
92
92
93
93
pub ( crate ) fn record ( & self , krate : i32 , version : i32 , target : & str ) {
94
- self . crates . insert ( krate, Instant :: now ( ) ) ;
95
- self . versions . insert ( version, Instant :: now ( ) ) ;
94
+ let now = Instant :: now ( ) ;
95
+ self . crates . insert ( krate, now) ;
96
+ self . versions . insert ( version, now) ;
96
97
self . platforms
97
- . insert ( ( version, TargetAtom :: from ( target) ) , Instant :: now ( ) ) ;
98
+ . insert ( ( version, TargetAtom :: from ( target) ) , now) ;
98
99
}
99
100
100
101
pub ( crate ) fn gather ( & self , metrics : & Metrics ) {
@@ -116,7 +117,7 @@ impl RecentlyAccessedReleases {
116
117
}
117
118
118
119
// Only retain items accessed within the last hour
119
- return elapsed < Duration :: from_secs ( 60 * 60 ) ;
120
+ elapsed < Duration :: from_secs ( 60 * 60 )
120
121
} ) ;
121
122
122
123
metric. with_label_values ( & [ "one hour" ] ) . set ( hour_count) ;
You can’t perform that action at this time.
0 commit comments