Commit 0138feda authored by 赵威's avatar 赵威

get data

parent 091dd119
import datetime import datetime
from utils.cache import redis_client4 from utils.cache import redis_client2
from utils.portrait import user_portrait_tag3_get_candidate_unread_list from utils.portrait import user_portrait_tag3_get_candidate_unread_list
...@@ -8,21 +8,19 @@ def user_portrait_scan_info(): ...@@ -8,21 +8,19 @@ def user_portrait_scan_info():
try: try:
round = 0 round = 0
all_count = 0 all_count = 0
keys = "doris:user_portrait:tag3:candidate:diary:device_id:*" keys = "doris:user_portrait:tag3:device_id:*"
cur, results = redis_client4.scan(0, keys, 3000) cur, results = redis_client2.scan(0, keys, 3000)
while cur != 0: while cur != 0:
round += 1 round += 1
print("round: " + str(round)) print("round: " + str(round))
cur, results = redis_client4.scan(cur, keys, 3000) cur, results = redis_client2.scan(cur, keys, 3000)
for key in results: for key in results:
key = str(key, "utf-8") key = str(key, "utf-8")
device_id = key.split(":")[-1] device_id = key.split(":")[-1]
print(device_id) print(device_id)
# print(user_portrait_tag3_get_candidate_unread_list(device_id, "diary")[:10]) print(user_portrait_tag3_get_candidate_unread_list(device_id, "diary")[:10])
all_count += 1 all_count += 1
# user_portrait_get_empty_candidates(device_id)
print("all count: " + str(all_count)) print("all count: " + str(all_count))
print("scan done " + str(datetime.datetime.now())) print("scan done " + str(datetime.datetime.now()))
except Exception as e: except Exception as e:
......
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