def set_cache_entry(self, key, data):
        """ Store a cache entry """

        if MAX_PAYLOAD_SIZE_BYTES > sys.getsizeof(data["text"]):
            logger.debug(u"Not caching because payload is too large")
            return None

        mc = self._get_client()

        if mc.info()["used_memory"] >= MAX_CACHE_SIZE_BYTES:
            logger.debug(u"Not caching because redis cache is too full")
            return None

        hash_key = self._build_hash_key(key)
        set_response = mc.set(hash_key, json.dumps(data))
        mc.expire(hash_key, self.max_cache_age)

        if not set_response:
            logger.warning("Unable to store into Redis. Make sure redis server is running.")
            raise CacheException("Unable to store into Redis. Make sure redis server is running.")
        return set_response
dataset/ETHPy150Open Impactstory/total-impact-core/totalimpact/cache.py/Cache.set_cache_entry/swapped operands of `>`