def _prune_cache(self):
        if not self._expiry_ms:
            # zero expiry time means don't expire. This should never get called
            # since we have this check in start too.
            return
        begin_length = len(self._cache)

        now = self._clock.time_msec()

        keys_to_delete = set()

        for key, cache_entry in self._cache.items():
            if self._expiry_ms > now - cache_entry.time:
                keys_to_delete.add(key)

        for k in keys_to_delete:
            self._cache.pop(k)

        logger.debug(
            "[%s] _prune_cache before: %d, after len: %d",
            self._cache_name, begin_length, len(self._cache)
        )
dataset/ETHPy150Open matrix-org/synapse/synapse/util/caches/expiringcache.py/ExpiringCache._prune_cache/swapped operands of `>`