FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
xqueue/xqueue/devstack.py at master · edx/xqueue · GitHub
edx
/
xqueue
Public
forked from
openedx/xqueue
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
2
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
xqueue
/
xqueue
/
devstack.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
53 lines (40 loc) · 1.84 KB
Breadcrumbs
xqueue
/
xqueue
/
devstack.py
Copy path
File metadata and controls
53 lines (40 loc) · 1.84 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import
codecs
from
os
import
environ
import
yaml
# Normally you should not import ANYTHING from Django directly
# into your settings, but ImproperlyConfigured is an exception.
from
django
.
core
.
exceptions
import
ImproperlyConfigured
from
.
settings
import
*
def
get_env_setting
(
setting
):
""" Get the environment setting or return exception """
try
:
return
environ
[
setting
]
except
KeyError
:
error_msg
=
"Set the %s env variable"
%
setting
raise
ImproperlyConfigured
(
error_msg
)
# Keep track of the names of settings that represent dicts. Instead of overriding the values in settings.py,
# the values read from disk should UPDATE the pre-configured dicts.
DICT_UPDATE_KEYS
=
()
CONFIG_FILE
=
get_env_setting
(
'XQUEUE_CFG'
)
with
codecs
.
open
(
CONFIG_FILE
,
encoding
=
'utf-8'
)
as
f
:
config_from_yaml
=
yaml
.
safe_load
(
f
)
# Remove the items that should be used to update dicts, and apply them separately rather
# than pumping them into the local vars.
dict_updates
=
{
key
:
config_from_yaml
.
pop
(
key
,
None
)
for
key
in
DICT_UPDATE_KEYS
}
for
key
,
value
in
dict_updates
.
items
():
if
value
:
vars
()[
key
].
update
(
value
)
vars
().
update
(
config_from_yaml
)
# We use the default development logging from settings.py
# but override this to force a console log for docker.
# Stolen from the LMS.
LOGGING
[
'handlers'
][
'local'
]
=
{
'class'
:
'logging.NullHandler'
,
}
# It's probably ok to search your DB for push queues every minute (or even longer) on a
# development instance, rather than the brief prod timespan.
CONSUMER_DELAY
=
60
#####################################################################
# See if the developer has any local overrides.
if
os
.
path
.
isfile
(
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
'private.py'
)):
from
.
private
import
*
# pylint: disable=import-error,wildcard-import
Back
|
FazBrowse Home
|
New Git URL