Commit 020e8d40 authored by 赵威's avatar 赵威

try 15 data

parent 8e3598d6
......@@ -82,10 +82,10 @@ def update_tag3_user_portrait(cl_id):
# TODO doris:user_portrait:tag3:device_id:
# TODO expire time
cl_id_portrait_key = "doris:test:device_id:" + str(cl_id)
key = "doris:test:device_id:" + str(cl_id)
redis_client = redis.StrictRedis.from_url("redis://:ReDis!GmTx*0aN9@172.16.40.173:6379")
redis_client.set(cl_id_portrait_key, json.dumps(res))
redis_client.expire(cl_id_portrait_key, 60 * 60 * 24)
redis_client.set(key, json.dumps(res))
redis_client.expire(key, 60 * 60 * 24)
write_user_portrait(cl_id, ",".join(first_solutions_score.keys()),
",".join(second_solutions_score.keys()), ",".join(first_demands_score.keys()),
......@@ -97,7 +97,7 @@ def update_tag3_user_portrait(cl_id):
def consume_kafka():
# TODO 30
sql = "select distinct cl_id from kafka_tag3_log where log_time > UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 5 day))"
sql = "select distinct cl_id from kafka_tag3_log where log_time > UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 15 day))"
db, cursor = get_jerry_test()
cursor.execute(sql)
device_ids_lst = [i[0] for i in cursor.fetchall()]
......
......@@ -407,7 +407,7 @@ def get_tag3_user_log(cl_id):
# CREATE TABLE `user_tag3_portrait` (
# `id` int(11) NOT NULL AUTO_INCREMENT,
# `date` int(11) NOT NULL,
# `date` text NOT NULL,
# `cl_id` text NOT NULL,
# `first_solutions` text NOT NULL,
# `second_solutions` text NOT NULL,
......
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