Commit dd9467a8 authored by 张彦钊's avatar 张彦钊

把获取用户活跃表的顺序放在最前面

parent ffd31e2c
...@@ -301,11 +301,8 @@ if __name__ == "__main__": ...@@ -301,11 +301,8 @@ if __name__ == "__main__":
cache_device_city_list = [] cache_device_city_list = []
differ = 0 differ = 0
while True: while True:
data_set_cid = pd.read_csv(path + "data_set_cid.csv")["cid"].values.tolist()
total_video_id = get_video_id(cache_video_id)
cache_video_id = total_video_id
start = time.time() start = time.time()
device_city_list = get_active_users(flag,path,differ) device_city_list = get_active_users(flag, path, differ)
# 过滤掉5分钟内预测过的用户 # 过滤掉5分钟内预测过的用户
device_city_list = list(set(tuple(device_city_list))-set(tuple(cache_device_city_list))) device_city_list = list(set(tuple(device_city_list))-set(tuple(cache_device_city_list)))
print("device_city_list") print("device_city_list")
...@@ -313,6 +310,9 @@ if __name__ == "__main__": ...@@ -313,6 +310,9 @@ if __name__ == "__main__":
if datetime.now().minute % 5 == 0: if datetime.now().minute % 5 == 0:
cache_device_city_list = [] cache_device_city_list = []
if device_city_list != []: if device_city_list != []:
data_set_cid = pd.read_csv(path + "data_set_cid.csv")["cid"].values.tolist()
total_video_id = get_video_id(cache_video_id)
cache_video_id = total_video_id
cache_device_city_list.extend(device_city_list) cache_device_city_list.extend(device_city_list)
for device_city in device_city_list: for device_city in device_city_list:
multi_proecess_update(device_city[0], device_city[1], data_set_cid, total_video_id) 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