Commit ·
009e9b1
1
Parent(s): 57f3a36
fix: tmp directory
Browse files31 unmodified lines32333435363738394041424331 unmodified linesdef clean_tmp_directory():# Allow 20 user keys to be stored.# Once that limitation is reached, deleted the oldest.list_files = sorted(Path(".fhe_keys/").iterdir(), key=os.path.getmtime)user_ids = []if len(list_files) > N_USER_KEY_STORED:n_files_to_delete = len(list_files) - N_USER_KEY_STOREDfor p in list_files[:n_files_to_delete]:user_ids.append(p.name)shutil.rmtree(p)31 unmodified lines32333435363738394041424331 unmodified linesdef clean_tmp_directory():# Allow 20 user keys to be stored.# Once that limitation is reached, deleted the oldest.path_sub_directories = sorted([f for f in Path(".fhe_keys/").iterdir() if f.is_dir()], key=os.path.getmtime)user_ids = []if len(path_sub_directories) > N_USER_KEY_STORED:n_files_to_delete = len(path_sub_directories) - N_USER_KEY_STOREDfor p in path_sub_directories[:n_files_to_delete]:user_ids.append(p.name)shutil.rmtree(p)
app.py+4-4