Update handler.py
Browse filesIncrease cache clean interval
- handler.py +1 -1
handler.py
CHANGED
@@ -37,7 +37,7 @@ class EndpointHandler():
|
|
37 |
|
38 |
def _cleanup_cache(self):
|
39 |
current_time = time.time()
|
40 |
-
if current_time - self.last_cache_cleanup >
|
41 |
# Sort the cache by last access time
|
42 |
sorted_cache = sorted(self.cache.items(), key = lambda x: x[1]["last_access"])
|
43 |
|
|
|
37 |
|
38 |
def _cleanup_cache(self):
|
39 |
current_time = time.time()
|
40 |
+
if current_time - self.last_cache_cleanup > 60 and len(self.cache) > self.max_cache_entries:
|
41 |
# Sort the cache by last access time
|
42 |
sorted_cache = sorted(self.cache.items(), key = lambda x: x[1]["last_access"])
|
43 |
|