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