Whisper / utils /storage.py
basyx's picture
Create storage.py
09d1921 verified
Raw
History Blame
299 Bytes
import os
import time
MAX_AGE = 60 * 60 # 1 hour
def cleanup(folder="jobs"):
now = time.time()
for f in os.listdir(folder):
path = os.path.join(folder, f)
if os.path.isfile(path):
if now - os.path.getmtime(path) > MAX_AGE:
os.remove(path)