

def load_from_cache(self, task, grab):
    with self.spider.timer.log_time('cache'):
        with self.spider.timer.log_time('cache.read'):
            cache_item = self.cache.get_item(grab.config['url'], timeout=task.cache_timeout)
            if (cache_item is None):
                return None
            else:
                with self.spider.timer.log_time('cache.read.prepare_request'):
                    grab.prepare_request()
                with self.spider.timer.log_time('cache.read.load_response'):
                    self.cache.load_response(grab, cache_item)
                task.log_request('CACHED')
                self.spider.stat.inc('spider:request-cache')
                return {
                    'ok': True,
                    'task': task,
                    'grab': grab,
                    'grab_config_backup': grab.dump_config(),
                    'emsg': None,
                }

dataset/ETHPy150Open lorien/grab/grab/spider/cache_pipeline.py CachePipeline.load_from_cache/VarMisuse@128/181 `grab`->`task`