Commit 60ad98b0 authored by lixiaofang's avatar lixiaofang

add

parent 4f05fe78
......@@ -109,21 +109,21 @@ def sync_user_similar_score():
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
@shared_task
def get_tag_count():
try:
# 获取搜索推荐热词
results_registr_tag = RegisterShowTag.objects.filter(is_deleted=False, is_online=1).count()
results_registr_tag = list(set(RegisterShowTag.objects.filter(is_deleted=False, is_online=1).values_list("tag_id", flat=True)))
# 获取符合条件的核心词
results_tag = Tag.objects.filter(is_online=True, collection=1).count()
results_tag = list(set(Tag.objects.filter(is_online=True, is_deleted=False, collection=1).values_list("id", flat=True)))
redis_registr_tag = "physical:search_hotword:results_registr_tag"
redis_tag = "physical:search_hotword:results_tag"
redis_client.set(redis_registr_tag, str(results_registr_tag))
redis_client.set(redis_tag, str(results_tag))
redis_client.set(redis_registr_tag, list(results_registr_tag))
redis_client.set(redis_tag, list(results_tag))
logging.info("get ")
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
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