mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 16:51:11 +03:00
check EACCES and only refresh cancel_flag
This commit is contained in:
parent
5279b102cb
commit
9fe44cfaae
@ -1672,14 +1672,14 @@ class RunProjectUpdate(BaseTask):
|
||||
start_time = time.time()
|
||||
while True:
|
||||
try:
|
||||
instance.refresh_from_db()
|
||||
instance.refresh_from_db(fields=['cancel_flag'])
|
||||
if instance.cancel_flag:
|
||||
logger.info(six.text_type("ProjectUpdate({0}) was cancelled".format(instance.pk)))
|
||||
return
|
||||
fcntl.flock(self.lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
break
|
||||
except IOError as e:
|
||||
if e.errno != errno.EAGAIN:
|
||||
if e.errno not in (errno.EAGAIN, errno.EACCES):
|
||||
os.close(self.lock_fd)
|
||||
logger.error(six.text_type("I/O error({0}) while trying to aquire lock on file [{1}]: {2}").format(e.errno, lock_path, e.strerror))
|
||||
raise
|
||||
|
Loading…
Reference in New Issue
Block a user