Commit 51d226f9 authored by 张彦钊's avatar 张彦钊

add delete temp log

parent 9faccb11
......@@ -17,15 +17,8 @@ def remove_files(fileDir):
os.remove(fileDir + "/" + eachFile)
def remove_tmp():
for eachFile in os.listdir("/tmp"):
if "xlearn" in eachFile:
os.remove("/tmp" + "/" + eachFile)
if __name__ == "__main__":
while True:
remove_tmp()
remove_files(DIRECTORY_PATH + "result")
print("运行一次")
time.sleep(5*60)
......@@ -5,6 +5,7 @@ import xlearn as xl
from userProfile import *
import time
from utils import *
import os
# 将device_id、city_id拼接到对应的城市热门日记表。注意:下面预测集特征顺序要与训练集保持一致
......@@ -93,7 +94,10 @@ if __name__ == "__main__":
while True:
empty,device_id_list = get_active_users()
if empty:
time.sleep(60)
for eachFile in os.listdir("/tmp"):
if "xlearn" in eachFile:
os.remove("/tmp" + "/" + eachFile)
time.sleep(58)
else:
old_device_id_list = pd.read_csv(DIRECTORY_PATH + "data_set_device_id.csv")["device_id"].values.tolist()
for device_id in device_id_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