

def cache_set(self, key, expiry, data):
    '\n        Add a result to the cache\n\n        :key: Cache key to use\n        :expiry: The expiry timestamp after which the result is stale\n        :data: The data to cache\n        '
    self.cache.set(key, (expiry, data), self.cache_ttl)
    if getattr(settings, 'CACHEBACK_VERIFY_CACHE_WRITE', True):
        (__, cached_data) = self.cache.get(key, (None, None))
        if ((data is not None) and (cached_data is None)):
            raise RuntimeError(('Unable to save data of type %s to cache' % type(data)))

dataset/ETHPy150Open codeinthehole/django-cacheback/cacheback/base.py Job.cache_set/original