Skip to content

fix: cap in-memory route and geocode caches at configurable max entries#112

Open
kush-mehra1 wants to merge 1 commit into
madanrajsagar:mainfrom
kush-mehra1:fix/issue-59-cache-bounds
Open

fix: cap in-memory route and geocode caches at configurable max entries#112
kush-mehra1 wants to merge 1 commit into
madanrajsagar:mainfrom
kush-mehra1:fix/issue-59-cache-bounds

Conversation

@kush-mehra1

Copy link
Copy Markdown

recentRouteCache and recentGeocodeCache were plain Map objects that grew without bound. expired entries were skipped on read but never evicted from memory.

added eviction logic: when cache exceeds CACHE_MAX_ENTRIES (default 200, env-configurable), the oldest entries are removed. eviction runs after every cache write.

Fixes #59

GSSOC 2026 contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

in-memory route cache grows unbounded

2 participants