Commit 4188321f authored by 张彦钊's avatar 张彦钊

解决cache_device_city_list为空列表

parent 6def316a
......@@ -251,13 +251,12 @@ if __name__ == "__main__":
device_city_list = get_active_users()
# 过滤掉5分钟内预测过的用户
device_city_list = list(set(tuple(device_city_list))-set(tuple(cache_device_city_list)))
if device_city_list != []:
cache_device_city_list.extend(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 != []:
cache_device_city_list.extend(device_city_list)
total_number += len(device_city_list)
print("累计预测用户总数:{}".format(total_number))
for device_city in device_city_list:
# start = time.time()
multi_proecess_update(device_city[0], device_city[1], data_set_cid, total_video_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