def update_cache(self, chat, room_id):
    self.cache[room_id].append(chat)
    if (len(self.cache[room_id]) > self.cache_size):
        self.cache[room_id] = self.cache[(- self.cache_size):]
def update_cache(self, chat, room_id):
    self.cache[room_id].append(chat)
    if (len(self.cache[room_id]) > self.cache_size):
        self.cache[room_id] = self.cache[(- self.cache_size):]