Philipp Hörist pushed to branch master at gajim / gajim


Commits:
7402594f by Philipp Hörist at 2023-01-07T14:13:35+01:00
ci: Handle race conditions better when creating ftp folder

Retrieving a list of folders to check if a folder is created leads
to a race condition, if multiple jobs try to deploy at the
same time.

- - - - -


1 changed file:

- .ci/deploy.py


Changes:

=====================================
.ci/deploy.py
=====================================
@@ -10,6 +10,7 @@
 import os
 import sys
 from datetime import date
+from ftplib import error_perm
 from ftplib import FTP_TLS
 from pathlib import Path
 
@@ -70,9 +71,10 @@ def get_dir_list(ftp: FTP_TLS) -> list[str]:
 def create_release_folder(ftp: FTP_TLS, tag: str) -> None:
     ftp.cwd(RELEASE_FOLDER_BASE)
     folder = get_release_folder_from_tag(tag)
-    dir_list = get_dir_list(ftp)
-    if folder not in dir_list:
+    try:
         ftp.mkd(folder)
+    except error_perm:
+        pass
     ftp.cwd(folder)
 
 



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/7402594f83785041f213f64a1fe00c396fdaefa7

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/7402594f83785041f213f64a1fe00c396fdaefa7
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to