mirror of
https://github.com/openhwgroup/cvw.git
synced 2025-06-27 17:01:20 -04:00
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:
commit
354402451a
1 changed files with 2 additions and 2 deletions
|
@ -830,14 +830,14 @@ def main():
|
|||
#############################################
|
||||
# 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):
|
||||
try:
|
||||
cvw_dir = os.path.join(args.path,log_dir,"cvw")
|
||||
cvw_mtime = os.stat(cvw_dir).st_mtime
|
||||
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)
|
||||
except Exception as e:
|
||||
if os.path.exists(cvw_dir):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue