def excute_search_task(): keywords = 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 test_get_keyword(self): """ 获取搜索关键词 :return: """ from db.search_words import get_search_keywords rs = get_search_keywords() self.assertEqual(len(rs), 10)
def excute_search_task(): # keyword应该从数据库中读取出来 rows = get_search_keywords() for row in rows: search_keyword(row)