diff --git a/Cargo.lock b/Cargo.lock index 0a9a8b4..f0519cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -530,7 +530,7 @@ dependencies = [ [[package]] name = "enex-rcache" -version = "0.2.0" +version = "0.2.1" dependencies = [ "actix-web", "actix-web-httpauth", diff --git a/Cargo.toml b/Cargo.toml index 0e6fff8..f195616 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enex-rcache" -version = "0.2.0" +version = "0.2.1" edition = "2024" [dependencies] diff --git a/src/handlers.rs b/src/handlers.rs index 8af3482..bcd53bc 100644 --- a/src/handlers.rs +++ b/src/handlers.rs @@ -81,6 +81,7 @@ pub async fn put_cache_item( }, ); shared.stats.successful_writes += 1; + shared.stats.cache_size += size; update_boundary_items(&mut shared.stats, &shared.lru_cache); }); debug!("Created cache item {}", hash.as_str()); diff --git a/src/helpers.rs b/src/helpers.rs index ca74696..97f0bc0 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -20,13 +20,13 @@ pub fn update_boundary_items(stats: &mut Stats, entries: &WeightedLRUCache value.meta.create_at) { stats.oldest_entry_at = Some(value.meta.create_at); } if stats .newest_entry_at - .is_none_or(|newest_entry| newest_entry > value.meta.create_at) + .is_none_or(|newest_entry| newest_entry < value.meta.create_at) { stats.newest_entry_at = Some(value.meta.create_at); }