mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-16 15:45:04 +08:00
Tolerate a config directory created concurrently by another process
Tool shed servers started by parallel pytest-xdist workers all create the same compiled template directory; whichever lost the race failed to start with 'File exists'.
This commit is contained in:
@@ -691,7 +691,8 @@ class CommonConfigurationMixin:
|
||||
def _ensure_directory(self, path):
|
||||
if path not in [None, False] and not os.path.isdir(path):
|
||||
try:
|
||||
os.makedirs(path)
|
||||
# Another process starting with the same configuration may create it first.
|
||||
os.makedirs(path, exist_ok=True)
|
||||
except Exception as e:
|
||||
raise ConfigurationError(f"Unable to create missing directory: {path}\n{unicodify(e)}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user