Skip to content

Commit 5a68198

Browse files
committed
Prevent 500 errors on file move race condition.
- Legacy-Id: 8480
1 parent 42fe537 commit 5a68198

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

ietf/doc/expire.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,13 @@ def move_file(f):
114114
dst = os.path.join(settings.INTERNET_DRAFT_ARCHIVE_DIR, f)
115115

116116
if os.path.exists(src):
117-
shutil.move(src, dst)
117+
try:
118+
shutil.move(src, dst)
119+
except IOError as e:
120+
if "No such file or directory" in str(e):
121+
pass
122+
else:
123+
raise
118124

119125
src_dir = Path(settings.INTERNET_DRAFT_PATH)
120126
for file in src_dir.glob("%s-%s.*" % (doc.name, rev)):

0 commit comments

Comments
 (0)