1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00

Merge pull request #2568 from AlanCoding/fussy_logger

Add log statement if canceling takes way too long
This commit is contained in:
Alan Rominger 2018-07-19 10:30:45 -04:00 committed by GitHub
commit eb22e09e4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1039,6 +1039,9 @@ class BaseTask(Task):
instance = self.update_model(pk)
if instance.cancel_flag:
status = 'canceled'
cancel_wait = (now() - instance.modified).seconds if instance.modified else 0
if cancel_wait > 5:
logger.warn(six.text_type('Request to cancel {} took {} seconds to complete.').format(instance.log_format, cancel_wait))
instance = self.update_model(pk, status=status, result_traceback=tb,
output_replacements=output_replacements,