Commit 01e4829c authored by 张彦钊's avatar 张彦钊

过滤掉5分钟内预测过的用户

parent 8cab2688
......@@ -249,9 +249,11 @@ if __name__ == "__main__":
total_video_id = get_video_id(cache_video_id)
cache_video_id = total_video_id
device_city_list = get_active_users()
# 过滤掉上次预测过的用户
# 过滤掉5分钟内预测过的用户
device_city_list = list(set(device_city_list)-set(cache_device_city_list))
cache_device_city_list = device_city_list
cache_device_city_list.append(device_city_list)
if datetime.now().minute % 5 == 0:
cache_device_city_list = []
total_number += len(device_city_list)
print("累计预测用户总数:{}".format(total_number))
if device_city_list != []:
......
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