mirror of
https://github.com/ansible/awx.git
synced 2026-04-05 18:19:21 -02:30
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:
@@ -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):
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user