Commit 6def316a authored by 张彦钊's avatar 张彦钊

解决cache_device_city_list为空列表

parent 9ecdce8b
...@@ -250,10 +250,9 @@ if __name__ == "__main__": ...@@ -250,10 +250,9 @@ if __name__ == "__main__":
cache_video_id = total_video_id cache_video_id = total_video_id
device_city_list = get_active_users() device_city_list = get_active_users()
# 过滤掉5分钟内预测过的用户 # 过滤掉5分钟内预测过的用户
if cache_device_city_list != []: device_city_list = list(set(tuple(device_city_list))-set(tuple(cache_device_city_list)))
device_city_list = list(set(device_city_list)-set(cache_device_city_list))
if device_city_list != []: if device_city_list != []:
cache_device_city_list.append(device_city_list) cache_device_city_list.extend(device_city_list)
if datetime.now().minute % 5 == 0: if datetime.now().minute % 5 == 0:
cache_device_city_list = [] cache_device_city_list = []
total_number += len(device_city_list) total_number += len(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