Commit 536d8242 by Calen Pennington

Merge branch 'release'

parents c303687b d0be9078
...@@ -52,8 +52,21 @@ def _reserve_task(course_id, task_type, task_key, task_input, requester): ...@@ -52,8 +52,21 @@ def _reserve_task(course_id, task_type, task_key, task_input, requester):
""" """
if _task_is_running(course_id, task_type, task_key): if _task_is_running(course_id, task_type, task_key):
log.warning("Duplicate task found for task_type %s and task_key %s", task_type, task_key)
raise AlreadyRunningError("requested task is already running") raise AlreadyRunningError("requested task is already running")
try:
most_recent_id = InstructorTask.objects.latest('id').id
except InstructorTask.DoesNotExist:
most_recent_id = "None found"
finally:
log.warning(
"No duplicate tasks found: task_type %s, task_key %s, and most recent task_id = %s",
task_type,
task_key,
most_recent_id
)
# Create log entry now, so that future requests will know it's running. # Create log entry now, so that future requests will know it's running.
return InstructorTask.create(course_id, task_type, task_key, task_input, requester) return InstructorTask.create(course_id, task_type, task_key, task_input, requester)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment