Merge pull request #1407 from jordancarlin/dev

Update nightly to delete cvw directories after 1 week instead of 1 day
This commit is contained in:
David Harris 2025-05-08 13:43:13 -07:00 committed by GitHub
commit 354402451a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -830,14 +830,14 @@ def main():
############################################# #############################################
# DELETE REPOSITORY OF PREVIOUS NIGHTLYS # # DELETE REPOSITORY OF PREVIOUS NIGHTLYS #
############################################# #############################################
threshold = time.time() - 86400*1 threshold = time.time() - 86400*7 # 1 week
for log_dir in os.listdir(args.path): for log_dir in os.listdir(args.path):
try: try:
cvw_dir = os.path.join(args.path,log_dir,"cvw") cvw_dir = os.path.join(args.path,log_dir,"cvw")
cvw_mtime = os.stat(cvw_dir).st_mtime cvw_mtime = os.stat(cvw_dir).st_mtime
if cvw_mtime < threshold: if cvw_mtime < threshold:
logger.info(f"Found {cvw_dir} older than 1 day, removing") logger.info(f"Found {cvw_dir} older than 1 week, removing")
shutil.rmtree(cvw_dir) shutil.rmtree(cvw_dir)
except Exception as e: except Exception as e:
if os.path.exists(cvw_dir): if os.path.exists(cvw_dir):