Commit 8b15e300 authored by Vasyl Bodnaruk's avatar Vasyl Bodnaruk

Fix bug in pipeline with Redis

Issues was: select from db return tuple, not single item
parent 3ec40158
......@@ -17,8 +17,7 @@ class ExaPipeline(object):
self.db = Database(**db)
self.buffer = redis.StrictRedis()
for i in self.db.select('select url from wp_esi_news_accept'):
self.buffer.set(i, True)
self.urls = {i[0] for i in self.db.select('select url from wp_esi_news_accept')}
self.buffer.set(i[0], True)
super(ExaPipeline, self).__init__()
def open_spider(self, spider):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment