Skip to content

Commit b3efada

Browse files
committed
Add an upper limit to number of recently accessed releases that will be tracked
1 parent 050deb5 commit b3efada

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/metrics/mod.rs

+5
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ impl RecentlyAccessedReleases {
9191
}
9292

9393
pub(crate) fn record(&self, krate: i32, version: i32, target: &str) {
94+
if self.platforms.len() > 100_000 {
95+
// Avoid filling the maps _too_ much, we should never get anywhere near this limit
96+
return;
97+
}
98+
9499
let now = Instant::now();
95100
self.crates.insert(krate, now);
96101
self.versions.insert(version, now);

0 commit comments

Comments
 (0)