def set_stop_stats(spider_id): key = '{}_STATS'.format(spider_id) BaseRedis.set(key, 'stopped')
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