Implement global job timeout mechanism.

This commit is contained in:
Aaron Tan 2016-09-15 14:56:27 -04:00
parent 2eda6b9528
commit 69be94feb9

View File

@ -517,8 +517,9 @@ class BaseTask(Task):
if pexpect_sleep is not None:
logger.info("Suspending Job Execution for QA Work")
time.sleep(pexpect_sleep)
# TODO: Update job_timeout using instance field instead.
job_timeout = 10
local_timeout = getattr(instance, 'timeout', 0)
global_timeout = getattr(settings, 'JOB_TIMEOUT', 0)
job_timeout = global_timeout if local_timeout == 0 else local_timeout
child = pexpect.spawnu(args[0], args[1:], cwd=cwd, env=env)
child.logfile_read = logfile
canceled = False