code: def clear_old_cache(self, key_added):
      if self.max_size is None:
          return
  
      # buffer to delete, to not run delete on every adding
      buffer_size = 5
  
      cur_count = self.client.hlen(self.category)
  
      # remove oldest
      if cur_count > self.max_size + buffer_size:
          # 5 is buffer to delete, to not run delete on every adding
  
          keys = self.client.hgetall(self.category)
          # to list
          keys = list(keys.items())
          # sort by timestamp
          keys.sort(key=lambda x: x[1])
  
          for key, _ in keys[: cur_count - self.max_size]:
              self.delete_key(key)
  
imports: import os
  import time
  from abc import ABC
  from pathlib import Path
  import hashlib
  import typing
  import pandas
  import walrus
  from mindsdb.utilities.config import Config
  from mindsdb.utilities.json_encoder import CustomJSONEncoder
  from mindsdb.interfaces.storage.fs import FileLock
  from mindsdb.utilities.context import context
label_desc: Use image node_id 2 for calling the RedisCache obj's underlying member method code with example usage: obj.clear_old_cache(key_added) without return types