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
75bf9c6f
Commit
75bf9c6f
authored
Nov 01, 2012
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate function for send_to_xqueue
parent
0735e5ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
23 deletions
+18
-23
lms/djangoapps/certificates/queue.py
+18
-23
No files found.
lms/djangoapps/certificates/queue.py
View file @
75bf9c6f
...
@@ -122,14 +122,7 @@ class XQueueCertInterface(object):
...
@@ -122,14 +122,7 @@ class XQueueCertInterface(object):
}
}
key
=
cert
.
key
key
=
cert
.
key
xheader
=
make_xheader
(
self
.
__send_to_xqueue
(
contents
,
key
)
'http://{0}/certificate'
.
format
(
settings
.
SITE_NAME
),
key
,
'test-pull'
)
(
error
,
msg
)
=
self
.
xqueue_interface
.
send_to_queue
(
header
=
xheader
,
body
=
json
.
dumps
(
contents
))
if
error
:
logger
.
critical
(
'Unable to add a request to the queue'
)
raise
Exception
(
'Unable to send queue message'
)
cert
.
save
()
cert
.
save
()
return
cert_status
return
cert_status
...
@@ -174,12 +167,7 @@ class XQueueCertInterface(object):
...
@@ -174,12 +167,7 @@ class XQueueCertInterface(object):
}
}
key
=
cert
.
key
key
=
cert
.
key
xheader
=
make_xheader
(
self
.
__send_to_xqueue
(
contents
,
key
)
'http://{0}/certificate'
.
format
(
settings
.
SITE_NAME
),
key
,
'test-pull'
)
(
error
,
msg
)
=
self
.
xqueue_interface
.
send_to_queue
(
header
=
xheader
,
body
=
json
.
dumps
(
contents
))
cert
.
save
()
cert
.
save
()
return
cert_status
return
cert_status
...
@@ -231,15 +219,22 @@ class XQueueCertInterface(object):
...
@@ -231,15 +219,22 @@ class XQueueCertInterface(object):
'course_id'
:
course_id
,
'course_id'
:
course_id
,
'name'
:
profile
.
name
,
'name'
:
profile
.
name
,
}
}
xheader
=
make_xheader
(
'http://{0}/update_certificate?{1}'
.
format
(
self
.
__send_to_xqueue
(
contents
,
key
)
key
,
settings
.
SITE_NAME
),
key
,
'test-pull'
)
(
error
,
msg
)
=
self
.
xqueue_interface
.
send_to_queue
(
header
=
xheader
,
body
=
json
.
dumps
(
contents
))
if
error
:
logger
.
critical
(
'Unable to post results to qserver'
)
raise
Exception
(
'Unable to send queue message'
)
cert
.
save
()
cert
.
save
()
return
cert_status
return
cert_status
def
__send_to_xqueue
(
self
,
contents
,
key
):
# TODO - need to read queue name from settings
xheader
=
make_xheader
(
'http://{0}/update_certificate?{1}'
.
format
(
key
,
settings
.
SITE_NAME
),
key
,
'test-pull'
)
(
error
,
msg
)
=
self
.
xqueue_interface
.
send_to_queue
(
header
=
xheader
,
body
=
json
.
dumps
(
contents
))
if
error
:
logger
.
critical
(
'Unable to add a request to the queue'
)
raise
Exception
(
'Unable to send queue message'
)
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