Fix obvious logical bug with project folder pre-creation (#5155)

This commit is contained in:
Alan Rominger 2021-06-24 14:00:53 -04:00 committed by Shane McDonald
parent 8dc788dbcb
commit 390e1f9a0a
No known key found for this signature in database
GPG Key ID: 6F374AF6E9EB9374

View File

@ -2178,8 +2178,6 @@ class RunProjectUpdate(BaseTask):
if not os.path.exists(settings.PROJECTS_ROOT):
os.mkdir(settings.PROJECTS_ROOT)
project_path = instance.project.get_project_path(check_if_exists=False)
if not os.path.exists(project_path):
os.makedirs(project_path) # used as container mount
self.acquire_lock(instance)
@ -2192,6 +2190,9 @@ class RunProjectUpdate(BaseTask):
else:
self.original_branch = git_repo.active_branch
if not os.path.exists(project_path):
os.makedirs(project_path) # used as container mount
stage_path = os.path.join(instance.get_cache_path(), 'stage')
if os.path.exists(stage_path):
logger.warning('{0} unexpectedly existed before update'.format(stage_path))