Exemple #1
0
def jobDetails(job_num):
	
	# get number of estimate tasks
	job_task_num = int(redisHandles.r_job_handle.get("job_{job_num}_est_count".format(job_num=job_num)))

	# get parent object
	job_SQL = db.session.query(models.user_jobs).filter(models.user_jobs.job_num == job_num).first()
	print "job celery task id:",job_SQL.celery_task_id

	job_details = jobs.getTaskDetails(job_SQL.celery_task_id)	
	print job_details

	# get tasks
	tasks_package = {}
	tasks_package['SUCCESS'] = []
	tasks_package['PENDING'] = []
	tasks_package['RETRY'] = []
	tasks_package['FAILURE'] = []

	if job_details.children != None:
		for child in job_details.children:
			tasks_package[child.status].append([child.task_id,child.task_name])
		return render_template("jobDetails.html",job_num=job_num,tasks_package=tasks_package)	
	else:
		return render_template("jobDetails.html",job_num=job_num)	
Exemple #2
0
def taskDetails(task_id,job_num):
	
	if task_id != "NULL":	
		# async, celery status
		task_async = jobs.getTaskDetails(task_id)
		# fm2 recorded values
		task_returns = redisHandles.r_job_handle.get(task_id).split(",")		
		PID = task_returns[1]	

	else:
		print "We're dealing with a local job, not Celerized"
		PID = "N/A"
		task_async = {
			"status":"N/A",
			"result":"N/A"
		}

	return render_template("taskDetails.html",task_async=task_async,PID=PID)