def test_keywords_oper(self): db_session.execute("insert into {} ({}.keyword) values ('".format( keywords.name, keywords.name) + FAKE_STR + "')") assert len(KeywordsOper.get_search_keywords()) == 1 KeywordsOper.set_useless_keyword('火影') assert len(KeywordsOper.get_search_keywords()) == 0
def test_keywords_oper(self): db_session.execute("insert into {} ({}.keyword) values ('".format(keywords.name, keywords.name) + FAKE_STR + "')") assert len(KeywordsOper.get_search_keywords()) == 1 KeywordsOper.set_useless_keyword('火影') assert len(KeywordsOper.get_search_keywords()) == 0
def execute_search_task(): keywords = KeywordsOper.get_search_keywords() for each in keywords: app.send_task('tasks.search.search_keyword', args=(each[0], each[1]), queue='search_crawler', routing_key='for_search_info')
def execute_topic_task(): keywords = KeywordsOper.get_search_keywords() for each in keywords: app.send_task('tasks.topic.search_keyword_topic', args=(each[0], each[1]), queue='topic_crawler', routing_key='topic_info')