-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from edx/renzo/avoid-accidental-initialization
Avoid initialization of Celery when used as a package
- Loading branch information
Showing
5 changed files
with
14 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
import os | ||
from celery import Celery | ||
|
||
from ecommerce_worker.configuration import CONFIGURATION_MODULE | ||
|
||
# Environment variable indicating which configuration module to use. | ||
CONFIGURATION = 'WORKER_CONFIGURATION_MODULE' | ||
|
||
# Set the default configuration module, if one is not aleady defined. | ||
os.environ.setdefault(CONFIGURATION, 'ecommerce_worker.configuration.local') | ||
os.environ.setdefault(CONFIGURATION_MODULE, 'ecommerce_worker.configuration.local') | ||
|
||
app = Celery('ecommerce_worker') | ||
# See http://celery.readthedocs.org/en/latest/userguide/application.html#config-from-envvar. | ||
app.config_from_envvar(CONFIGURATION) | ||
app.config_from_envvar(CONFIGURATION_MODULE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters