Open leadscloud opened 9 years ago
if not self.store():
logger.error(
'No results to store for keyword: "{}" in search engine: {}'.format(self.query,
self.search_engine_name))
to
if not self.store():
logger.error(
'No results to store for keyword: "{}" in search engine: {}'.format(self.query,
self.search_engine_name))
return
Because when we couldn't store any serp results we still want to know that the page was not successfully resquested. In this case:
if serp.num_results:
self.session.add(serp)
self.session.commit()
store_serp_result(serp)
return True
else:
return False
we dismiss all negative results.
But you are somewhat correct. This could be still improved...
if the page is access denied. or broken page, the cache also be save it.