Spaces:
Runtime error
Runtime error
Hendrik Schroeter commited on
Commit ·
fe04ae7
1
Parent(s): 46414ac
try fix filtering
Browse files252 unmodified lines253254255256257258259260261262263252 unmodified linesdef cleanup_tmp(filter: List[str] = [], hours_keep=2):filter.append("p232")# Cleanup some old wav filesif os.path.exists("/tmp"):for f in glob.glob("/tmp/*"):is_old = (time.time() - os.path.getmtime(f)) / 3600 > hours_keepif is_old and (filt not in f for filt in filter):try:os.remove(f)logger.info(f"Removed file {f}")252 unmodified lines253254255256257258259260261262263264265252 unmodified linesdef cleanup_tmp(filter: List[str] = [], hours_keep=2):filter.append("p232")logger.info(f"{filter}")# Cleanup some old wav filesif os.path.exists("/tmp"):for f in glob.glob("/tmp/*"):is_old = (time.time() - os.path.getmtime(f)) / 3600 > hours_keepfiltered = any(filt in f for filt in filter)if is_old and not filtered:try:os.remove(f)logger.info(f"Removed file {f}")
app.py+3-1