(self)
| 43 | |
| 44 | # Only keep last 10 accessed json in memory |
| 45 | def checkLimit(self): |
| 46 | if len(self.cached_keys) > 10: |
| 47 | key_deleted = self.cached_keys.pop(0) |
| 48 | dict.__setitem__(self, key_deleted, False) |
| 49 | |
| 50 | def addCachedKey(self, key): |
| 51 | if key not in self.cached_keys and key != "content.json" and len(key) > 40: # Always keep keys smaller than 40 char |
no test coverage detected