lock projects on project sync

* Use filesystem, blocking, locks to prevent two project syncs for the
same project from running the project update playbook at the same time.
This commit is contained in:
Chris Meyers
2017-04-11 14:58:30 -04:00
parent 6b06e741e0
commit 648aa470d7
2 changed files with 37 additions and 0 deletions

View File

@@ -208,6 +208,12 @@ class ProjectOptions(models.Model):
results.append(smart_text(playbook))
return sorted(results, key=lambda x: smart_str(x).lower())
def get_lock_file(self):
proj_path = self.get_project_path()
if proj_path:
return os.path.join(proj_path, 'tower_sync.lock')
return None
class Project(UnifiedJobTemplate, ProjectOptions, ResourceMixin):
'''