Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
536d8242
Commit
536d8242
authored
Jan 07, 2014
by
Calen Pennington
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release'
parents
c303687b
d0be9078
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
lms/djangoapps/instructor_task/api_helper.py
+13
-0
No files found.
lms/djangoapps/instructor_task/api_helper.py
View file @
536d8242
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment