forked from teamhephy/controller
-
Notifications
You must be signed in to change notification settings - Fork 0
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 teamhephy#60 from jianxiaoguo/main
fix(controller): upgrade celery config
- Loading branch information
Showing
2 changed files
with
22 additions
and
19 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,9 +1,30 @@ | ||
import os | ||
from celery import Celery, platforms | ||
|
||
|
||
class Config: | ||
# Celery Configuration Options | ||
timezone = "Asia/Shanghai" | ||
enable_utc = True | ||
task_serializer = 'pickle' | ||
accept_content = frozenset([ | ||
'application/data', | ||
'application/text', | ||
'application/json', | ||
'application/x-python-serialize', | ||
]) | ||
task_track_started = True | ||
task_time_limit = 30 * 60 | ||
worker_max_tasks_per_child = 200 | ||
result_expires = 24 * 60 * 60 | ||
broker_url = os.environ.get('DRYCC_RABBITMQ_URL', 'amqp://guest:[email protected]:5672/') # noqa | ||
cache_backend = 'django-cache' | ||
task_default_queue = 'priority.middle' | ||
|
||
|
||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'api.settings.production') | ||
app = Celery('drycc') | ||
app.config_from_object('django.conf:settings', namespace='CELERY') | ||
app.config_from_object(Config) | ||
app.conf.update( | ||
task_routes={ | ||
'api.tasks.retrieve_resource': {'queue': 'priority.high'}, | ||
|
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 |
---|---|---|
|
@@ -469,24 +469,6 @@ | |
} | ||
} | ||
|
||
# Celery Configuration Options | ||
timezone = "Asia/Shanghai" | ||
enable_utc = True | ||
task_serializer = 'pickle' | ||
accept_content = frozenset([ | ||
'application/data', | ||
'application/text', | ||
'application/json', | ||
'application/x-python-serialize', | ||
]) | ||
task_track_started = True | ||
task_time_limit = 30 * 60 | ||
worker_max_tasks_per_child = 200 | ||
result_expires = 24 * 60 * 60 | ||
broker_url = os.environ.get('DRYCC_RABBITMQ_URL', 'amqp://guest:[email protected]:5672/') # noqa | ||
cache_backend = 'django-cache' | ||
task_default_queue = 'priority.middle' | ||
|
||
# Influxdb Configuration Options | ||
DRYCC_INFLUXDB_URL = os.environ.get('DRYCC_INFLUXDB_URL', 'http://localhost:8086') | ||
DRYCC_INFLUXDB_BUCKET = os.environ.get('DRYCC_INFLUXDB_BUCKET', 'drycc') | ||
|