예제 #1
0
    def test_seedids_oper(self):
        SeedidsOper.insert_seeds(FAKE_IDS)
        assert len(SeedidsOper.get_seed_ids()) == 2
        assert SeedidsOper.get_seed_by_id(FAKE_ID) is not None

        SeedidsOper.set_seed_crawled(FAKE_ID, 1)
        assert len(SeedidsOper.get_seed_ids()) == 1
예제 #2
0
    def test_seedids_oper(self):
        SeedidsOper.insert_seeds(FAKE_IDS)
        assert len(SeedidsOper.get_seed_ids()) == 2
        assert SeedidsOper.get_seed_by_id(FAKE_ID) is not None

        SeedidsOper.set_seed_crawled(FAKE_ID, 1)
        assert len(SeedidsOper.get_seed_ids()) == 1
예제 #3
0
def execute_user_task():
    seeds = SeedidsOper.get_seed_ids()
    if seeds:
        for seed in seeds:
            app.send_task('tasks.user.crawl_person_infos',
                          args=(seed.uid, ),
                          queue='user_crawler',
                          routing_key='for_user_info')
예제 #4
0
def execute_user_task():
    # 查找seed表中报错的所有用户id,条件为is_crawled=0
    seeds = SeedidsOper.get_seed_ids()
    if seeds:
        for seed in seeds:
            # 提交任务
            app.send_task('tasks.user.crawl_person_infos',
                          args=(seed.uid, ),
                          queue='user_crawler',
                          routing_key='for_user_info')
예제 #5
0
def execute_user_task():
    seeds = SeedidsOper.get_seed_ids()
    if seeds:
        for seed in seeds:
            crawl_person_infos(seed.uid)
예제 #6
0
def execute_user_task():
    seeds = SeedidsOper.get_seed_ids()
    if seeds:
        for seed in seeds:
            app.send_task('tasks.user.crawl_person_infos', args=(seed.uid,), queue='user_crawler',
                          routing_key='for_user_info')