fix: cleanup ftp copy of repository on move to archive (#8335)

This commit is contained in:
Robert Sparks 2024-12-13 15:17:01 -06:00 committed by GitHub
parent 981f7aea3e
commit d59e102c9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -150,10 +150,17 @@ def move_draft_files_to_archive(doc, rev):
pass
else:
raise
def remove_ftp_copy(f):
mark = Path(settings.FTP_DIR) / "internet-drafts" / f
if mark.exists():
mark.unlink()
src_dir = Path(settings.INTERNET_DRAFT_PATH)
for file in src_dir.glob("%s-%s.*" % (doc.name, rev)):
move_file(str(file.name))
remove_ftp_copy(str(file.name))
def expire_draft(doc):
# clean up files