Commit 184cd5ce authored by 段英荣's avatar 段英荣

modify

parent 1dad0805
...@@ -98,7 +98,7 @@ class CollectData(object): ...@@ -98,7 +98,7 @@ class CollectData(object):
logging.info("consume topic_id:%s,device_id:%s" % (str(topic_id), str(device_id))) logging.info("consume topic_id:%s,device_id:%s" % (str(topic_id), str(device_id)))
tag_list = list() tag_list = list()
sql_query_results = TopicTag.objects.filter(is_online=True, topic_id=topic_id) sql_query_results = TopicTag.objects.using(settings.SLAVE_DB_NAME).filter(is_online=True, topic_id=topic_id)
for sql_item in sql_query_results: for sql_item in sql_query_results:
tag_list.append(sql_item.tag_id) tag_list.append(sql_item.tag_id)
...@@ -135,7 +135,7 @@ class CollectData(object): ...@@ -135,7 +135,7 @@ class CollectData(object):
topic_tag_id_dict = dict() topic_tag_id_dict = dict()
tag_list = list() tag_list = list()
sql_query_results = TopicTag.objects.filter(is_online=True, topic_id__in=exposure_topic_id_list) sql_query_results = TopicTag.objects.using(settings.SLAVE_DB_NAME).filter(is_online=True, topic_id__in=exposure_topic_id_list)
for sql_item in sql_query_results: for sql_item in sql_query_results:
tag_list.append(sql_item.tag_id) tag_list.append(sql_item.tag_id)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment