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
6289b190
Commit
6289b190
authored
May 07, 2015
by
Feanil Patel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pep8 and pylint.
parent
4cc39abf
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
35 additions
and
15 deletions
+35
-15
cms/__init__.py
+5
-1
cms/celery.py
+9
-3
cms/envs/aws.py
+1
-1
cms/envs/test.py
+1
-1
cms/envs/yaml_config.py
+1
-1
lms/__init__.py
+5
-1
lms/celery.py
+9
-3
lms/envs/aws.py
+1
-1
lms/envs/bok_choy.py
+1
-1
lms/envs/test.py
+1
-1
lms/envs/yaml_config.py
+1
-1
No files found.
cms/__init__.py
View file @
6289b190
"""
Celery needs to be loaded when the cms modules are so that task
registration and discovery can work correctly.
"""
from
__future__
import
absolute_import
from
__future__
import
absolute_import
# This will make sure the app is always imported when
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
# Django starts so that shared_task will use this app.
from
.celery
import
app
as
celery_app
from
.celery
import
APP
as
CELERY_APP
cms/celery.py
View file @
6289b190
"""
Import celery, load its settings from the django settings
and auto discover tasks in all installed django apps.
Taken from: http://celery.readthedocs.org/en/latest/django/first-steps-with-django.html
"""
from
__future__
import
absolute_import
from
__future__
import
absolute_import
import
os
import
os
...
@@ -9,9 +15,9 @@ from django.conf import settings
...
@@ -9,9 +15,9 @@ from django.conf import settings
# set the default Django settings module for the 'celery' program.
# set the default Django settings module for the 'celery' program.
os
.
environ
.
setdefault
(
'DJANGO_SETTINGS_MODULE'
,
'proj.settings'
)
os
.
environ
.
setdefault
(
'DJANGO_SETTINGS_MODULE'
,
'proj.settings'
)
app
=
Celery
(
'proj'
)
APP
=
Celery
(
'proj'
)
# Using a string here means the worker will not have to
# Using a string here means the worker will not have to
# pickle the object when using Windows.
# pickle the object when using Windows.
app
.
config_from_object
(
'django.conf:settings'
)
APP
.
config_from_object
(
'django.conf:settings'
)
app
.
autodiscover_tasks
(
lambda
:
settings
.
INSTALLED_APPS
)
APP
.
autodiscover_tasks
(
lambda
:
settings
.
INSTALLED_APPS
)
cms/envs/aws.py
View file @
6289b190
...
@@ -60,7 +60,7 @@ BROKER_POOL_LIMIT = 0
...
@@ -60,7 +60,7 @@ BROKER_POOL_LIMIT = 0
BROKER_CONNECTION_TIMEOUT
=
1
BROKER_CONNECTION_TIMEOUT
=
1
# For the Result Store, use the django cache named 'celery'
# For the Result Store, use the django cache named 'celery'
CELERY_RESULT_BACKEND
=
'djcelery.backends.cache:CacheBackend'
CELERY_RESULT_BACKEND
=
'djcelery.backends.cache:CacheBackend'
# When the broker is behind an ELB, use a heartbeat to refresh the
# When the broker is behind an ELB, use a heartbeat to refresh the
# connection and to detect if it has been dropped.
# connection and to detect if it has been dropped.
...
...
cms/envs/test.py
View file @
6289b190
...
@@ -187,7 +187,7 @@ simplefilter('ignore')
...
@@ -187,7 +187,7 @@ simplefilter('ignore')
################################# CELERY ######################################
################################# CELERY ######################################
CELERY_ALWAYS_EAGER
=
True
CELERY_ALWAYS_EAGER
=
True
CELERY_RESULT_BACKEND
=
'djcelery.backends.cache:CacheBackend'
CELERY_RESULT_BACKEND
=
'djcelery.backends.cache:CacheBackend'
########################### Server Ports ###################################
########################### Server Ports ###################################
...
...
cms/envs/yaml_config.py
View file @
6289b190
...
@@ -75,7 +75,7 @@ BROKER_POOL_LIMIT = 0
...
@@ -75,7 +75,7 @@ BROKER_POOL_LIMIT = 0
BROKER_CONNECTION_TIMEOUT
=
1
BROKER_CONNECTION_TIMEOUT
=
1
# For the Result Store, use the django cache named 'celery'
# For the Result Store, use the django cache named 'celery'
CELERY_RESULT_BACKEND
=
'djcelery.backends.cache:CacheBackend'
CELERY_RESULT_BACKEND
=
'djcelery.backends.cache:CacheBackend'
# When the broker is behind an ELB, use a heartbeat to refresh the
# When the broker is behind an ELB, use a heartbeat to refresh the
# connection and to detect if it has been dropped.
# connection and to detect if it has been dropped.
...
...
lms/__init__.py
View file @
6289b190
"""
Celery needs to be loaded when the cms modules are so that task
registration and discovery can work correctly.
"""
from
__future__
import
absolute_import
from
__future__
import
absolute_import
# This will make sure the app is always imported when
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
# Django starts so that shared_task will use this app.
from
.celery
import
app
as
celery_app
from
.celery
import
APP
as
CELERY_APP
lms/celery.py
View file @
6289b190
"""
Import celery, load its settings from the django settings
and auto discover tasks in all installed django apps.
Taken from: http://celery.readthedocs.org/en/latest/django/first-steps-with-django.html
"""
from
__future__
import
absolute_import
from
__future__
import
absolute_import
import
os
import
os
...
@@ -9,9 +15,9 @@ from django.conf import settings
...
@@ -9,9 +15,9 @@ from django.conf import settings
# set the default Django settings module for the 'celery' program.
# set the default Django settings module for the 'celery' program.
os
.
environ
.
setdefault
(
'DJANGO_SETTINGS_MODULE'
,
'proj.settings'
)
os
.
environ
.
setdefault
(
'DJANGO_SETTINGS_MODULE'
,
'proj.settings'
)
app
=
Celery
(
'proj'
)
APP
=
Celery
(
'proj'
)
# Using a string here means the worker will not have to
# Using a string here means the worker will not have to
# pickle the object when using Windows.
# pickle the object when using Windows.
app
.
config_from_object
(
'django.conf:settings'
)
APP
.
config_from_object
(
'django.conf:settings'
)
app
.
autodiscover_tasks
(
lambda
:
settings
.
INSTALLED_APPS
)
APP
.
autodiscover_tasks
(
lambda
:
settings
.
INSTALLED_APPS
)
lms/envs/aws.py
View file @
6289b190
...
@@ -64,7 +64,7 @@ BROKER_POOL_LIMIT = 0
...
@@ -64,7 +64,7 @@ BROKER_POOL_LIMIT = 0
BROKER_CONNECTION_TIMEOUT
=
1
BROKER_CONNECTION_TIMEOUT
=
1
# For the Result Store, use the django cache named 'celery'
# For the Result Store, use the django cache named 'celery'
CELERY_RESULT_BACKEND
=
'djcelery.backends.cache:CacheBackend'
CELERY_RESULT_BACKEND
=
'djcelery.backends.cache:CacheBackend'
# When the broker is behind an ELB, use a heartbeat to refresh the
# When the broker is behind an ELB, use a heartbeat to refresh the
# connection and to detect if it has been dropped.
# connection and to detect if it has been dropped.
...
...
lms/envs/bok_choy.py
View file @
6289b190
...
@@ -55,7 +55,7 @@ MEDIA_URL = "/static/uploads/"
...
@@ -55,7 +55,7 @@ MEDIA_URL = "/static/uploads/"
################################# CELERY ######################################
################################# CELERY ######################################
CELERY_ALWAYS_EAGER
=
True
CELERY_ALWAYS_EAGER
=
True
CELERY_RESULT_BACKEND
=
'djcelery.backends.cache:CacheBackend'
CELERY_RESULT_BACKEND
=
'djcelery.backends.cache:CacheBackend'
###################### Grade Downloads ######################
###################### Grade Downloads ######################
GRADES_DOWNLOAD
=
{
GRADES_DOWNLOAD
=
{
...
...
lms/envs/test.py
View file @
6289b190
...
@@ -299,7 +299,7 @@ GIT_REPO_DIR = TEST_ROOT / "course_repos"
...
@@ -299,7 +299,7 @@ GIT_REPO_DIR = TEST_ROOT / "course_repos"
################################# CELERY ######################################
################################# CELERY ######################################
CELERY_ALWAYS_EAGER
=
True
CELERY_ALWAYS_EAGER
=
True
CELERY_RESULT_BACKEND
=
'djcelery.backends.cache:CacheBackend'
CELERY_RESULT_BACKEND
=
'djcelery.backends.cache:CacheBackend'
######################### MARKETING SITE ###############################
######################### MARKETING SITE ###############################
...
...
lms/envs/yaml_config.py
View file @
6289b190
...
@@ -112,7 +112,7 @@ BROKER_POOL_LIMIT = 0
...
@@ -112,7 +112,7 @@ BROKER_POOL_LIMIT = 0
BROKER_CONNECTION_TIMEOUT
=
1
BROKER_CONNECTION_TIMEOUT
=
1
# For the Result Store, use the django cache named 'celery'
# For the Result Store, use the django cache named 'celery'
CELERY_RESULT_BACKEND
=
'djcelery.backends.cache:CacheBackend'
CELERY_RESULT_BACKEND
=
'djcelery.backends.cache:CacheBackend'
# When the broker is behind an ELB, use a heartbeat to refresh the
# When the broker is behind an ELB, use a heartbeat to refresh the
# connection and to detect if it has been dropped.
# connection and to detect if it has been dropped.
...
...
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