Commit 73331e88 authored by 高雅喆's avatar 高雅喆

用户历史订单tag写redis

parent 77e2d161
......@@ -72,6 +72,10 @@ def get_user_history_order_service_tag(user_id, stat_date):
tags_list_json = json.dumps(tags_list)
gm_kv_cli.set(user_history_order_tags_key, tags_list_json)
gm_kv_cli.expire(user_history_order_tags_key, time=30 * 24 * 60 * 60)
# 写redis
redis_client = redis.StrictRedis.from_url('redis://:ReDis!GmTx*0aN9@172.16.40.173:6379')
redis_client.set(user_history_order_tags_key, tags_list_json)
redis_client.expire(user_history_order_tags_key, time=30 * 24 * 60 * 60)
# 写tidb
sql_cl_id = "select device_id from statistic_device where id = (select max(device_id) from statistic_device_user where user_id = %d) " % (int(user_id))
cur_zhengxing.execute(sql_cl_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