Skip to content

Commit

Permalink
Fix: in peak times, ip-to-version-cache cycles before the 1 minute ma…
Browse files Browse the repository at this point in the history
…rk (#387)

The whole point of this cache is that it survives at least 1 minute,
as that is how long the client can take to get back tous.
  • Loading branch information
TrueBrain authored Feb 7, 2024
1 parent 19be5b6 commit 3fcdb4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bananas_server/application/bananas_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def set_version_from_source(source, version):
IP_TO_VERSION_CACHE[source.ip] = version

# Ensure this cache doesn't grow out of control.
if len(IP_TO_VERSION_CACHE) > 1000:
if len(IP_TO_VERSION_CACHE) > 10000:
IP_TO_VERSION_CACHE.pop(next(iter(IP_TO_VERSION_CACHE)))


Expand Down

0 comments on commit 3fcdb4b

Please sign in to comment.