Skip to content

Commit

Permalink
修改search中的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ResolveWang committed May 11, 2017
1 parent 2d0e411 commit ed67b2b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tasks/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
limit = get_max_search_page() + 1


@app.task
@app.task(ignore_result=True)
def search_keyword(keyword):
cur_page = 1
encode_keyword = url_parse.quote(keyword)
Expand Down Expand Up @@ -46,9 +46,11 @@ def search_keyword(keyword):
return


@app.task
@app.task(ignore_result=True)
def excute_search_task():
# keyword应该从数据库中读取出来
keywords = get_search_keywords()
for each in keywords:
app.send_task('tasks.user.search_keyword', args=(each,), queue='search_crawler', routing_key='for_search_info')
print(each[0])
app.send_task('tasks.search.search_keyword', args=(each[0],), queue='search_crawler',
routing_key='for_search_info')

0 comments on commit ed67b2b

Please sign in to comment.