Beispiel #1
0
 def set_stop_stats(spider_id):
     key = '{}_STATS'.format(spider_id)
     BaseRedis.set(key, 'stopped')
Beispiel #2
0
 def clean():
     BaseRedis.delete('PROXIES')
Beispiel #3
0
 def clean(spider_id):
     key = '{}_CRAWL_STATUS'.format(spider_id)
     BaseRedis.delete(key)
Beispiel #4
0
 def get_status(spider_id):
     key = '{}_CRAWL_STATUS'.format(spider_id)
     return BaseRedis.get(key) or 0
Beispiel #5
0
 def increase(spider_id):
     key = '{}_CRAWL_STATUS'.format(spider_id)
     crawl_count = int((BaseRedis.get(key) or 0)) + 1
     BaseRedis.set(key, crawl_count)
     return crawl_count
Beispiel #6
0
 def is_stop_stats(spider_id):
     key = '{}_STATS'.format(spider_id)
     return BaseRedis.get(key) == 'stopped'