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
3994615d
Commit
3994615d
authored
Dec 05, 2016
by
Eric Fischer
Committed by
GitHub
Dec 05, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14090 from edx/efischer/alt_queues
Get alternate queues from ENV_TOKENS
parents
30051a9e
b610215e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
14 deletions
+16
-14
cms/envs/aws.py
+8
-7
lms/envs/aws.py
+8
-7
No files found.
cms/envs/aws.py
View file @
3994615d
...
...
@@ -87,12 +87,6 @@ CELERY_QUEUES = {
DEFAULT_PRIORITY_QUEUE
:
{}
}
# Setup alternate queues, to allow access to cross-process workers
ALTERNATE_QUEUE_ENVS
=
os
.
environ
.
get
(
'ALTERNATE_WORKER_QUEUES'
,
''
)
.
split
()
ALTERNATE_QUEUES
=
[
DEFAULT_PRIORITY_QUEUE
.
replace
(
QUEUE_VARIANT
,
alternate
+
'.'
)
for
alternate
in
ALTERNATE_QUEUE_ENVS
]
CELERY_ROUTES
=
"{}celery.Router"
.
format
(
QUEUE_VARIANT
)
############# NON-SECURE ENV CONFIG ##############################
...
...
@@ -366,10 +360,17 @@ BROKER_URL = "{0}://{1}:{2}@{3}/{4}".format(CELERY_BROKER_TRANSPORT,
CELERY_BROKER_VHOST
)
BROKER_USE_SSL
=
ENV_TOKENS
.
get
(
'CELERY_BROKER_USE_SSL'
,
False
)
# Allow CELERY_QUEUES to be overwritten b
efore adding alternates
# Allow CELERY_QUEUES to be overwritten b
y ENV_TOKENS,
ENV_CELERY_QUEUES
=
ENV_TOKENS
.
get
(
'CELERY_QUEUES'
,
None
)
if
ENV_CELERY_QUEUES
:
CELERY_QUEUES
=
{
queue
:
{}
for
queue
in
ENV_CELERY_QUEUES
}
# Then add alternate environment queues
ALTERNATE_QUEUE_ENVS
=
ENV_TOKENS
.
get
(
'ALTERNATE_WORKER_QUEUES'
,
''
)
.
split
()
ALTERNATE_QUEUES
=
[
DEFAULT_PRIORITY_QUEUE
.
replace
(
QUEUE_VARIANT
,
alternate
+
'.'
)
for
alternate
in
ALTERNATE_QUEUE_ENVS
]
CELERY_QUEUES
.
update
(
{
alternate
:
{}
...
...
lms/envs/aws.py
View file @
3994615d
...
...
@@ -98,12 +98,6 @@ CELERY_QUEUES = {
HIGH_MEM_QUEUE
:
{},
}
# Setup alternate queues, to allow access to cross-process workers
ALTERNATE_QUEUE_ENVS
=
os
.
environ
.
get
(
'ALTERNATE_WORKER_QUEUES'
,
''
)
.
split
()
ALTERNATE_QUEUES
=
[
DEFAULT_PRIORITY_QUEUE
.
replace
(
QUEUE_VARIANT
,
alternate
+
'.'
)
for
alternate
in
ALTERNATE_QUEUE_ENVS
]
CELERY_ROUTES
=
"{}celery.Router"
.
format
(
QUEUE_VARIANT
)
# If we're a worker on the high_mem queue, set ourselves to die after processing
...
...
@@ -268,10 +262,17 @@ BULK_EMAIL_ROUTING_KEY_SMALL_JOBS = ENV_TOKENS.get('BULK_EMAIL_ROUTING_KEY_SMALL
# Queue to use for updating persistent grades
RECALCULATE_GRADES_ROUTING_KEY
=
ENV_TOKENS
.
get
(
'RECALCULATE_GRADES_ROUTING_KEY'
,
LOW_PRIORITY_QUEUE
)
# Allow CELERY_QUEUES to be overwritten b
efore adding alternates
# Allow CELERY_QUEUES to be overwritten b
y ENV_TOKENS,
ENV_CELERY_QUEUES
=
ENV_TOKENS
.
get
(
'CELERY_QUEUES'
,
None
)
if
ENV_CELERY_QUEUES
:
CELERY_QUEUES
=
{
queue
:
{}
for
queue
in
ENV_CELERY_QUEUES
}
# Then add alternate environment queues
ALTERNATE_QUEUE_ENVS
=
ENV_TOKENS
.
get
(
'ALTERNATE_WORKER_QUEUES'
,
''
)
.
split
()
ALTERNATE_QUEUES
=
[
DEFAULT_PRIORITY_QUEUE
.
replace
(
QUEUE_VARIANT
,
alternate
+
'.'
)
for
alternate
in
ALTERNATE_QUEUE_ENVS
]
CELERY_QUEUES
.
update
(
{
alternate
:
{}
...
...
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