Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
Project
Project
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
吴升宇
physical
Commits
81935202
Commit
81935202
authored
Feb 20, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
409486df
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
celery_task_router.py
physical/celery_task_router.py
+8
-8
settings.py
physical/settings.py
+6
-5
No files found.
physical/celery_task_router.py
View file @
81935202
# coding=utf-8
# coding=utf-8
from
__future__
import
unicode_literals
,
print_function
,
absolute_import
from
__future__
import
unicode_literals
,
print_function
,
absolute_import
import
itertools
import
itertools
from
django.conf
import
settings
from
django.conf
import
settings
import
logging
import
logging
class
CeleryTaskRouter
(
object
):
class
CeleryTaskRouter
(
object
):
queue_task_map
=
{
queue_task_map
=
{
"tapir-alpha"
:[
"tapir-alpha"
:
[
'injection.data_sync.tasks.write_to_es'
,
'injection.data_sync.tasks.write_to_es'
,
]
]
}
}
...
@@ -30,4 +31,4 @@ class CeleryTaskRouter(object):
...
@@ -30,4 +31,4 @@ class CeleryTaskRouter(object):
logging
.
info
(
"duan add,task is:
%
s"
%
str
(
task
))
logging
.
info
(
"duan add,task is:
%
s"
%
str
(
task
))
queue_name_or_none
=
self
.
task_queue_map
.
get
(
task
)
queue_name_or_none
=
self
.
task_queue_map
.
get
(
task
)
return
queue_name_or_none
return
queue_name_or_none
\ No newline at end of file
physical/settings.py
View file @
81935202
...
@@ -31,14 +31,15 @@ ALLOWED_HOSTS = []
...
@@ -31,14 +31,15 @@ ALLOWED_HOSTS = []
# Application definition
# Application definition
SENTRY_CELERY_ENDPOINT
=
"http://60b0004c8884420f8067fb32fc3ed244:20f97fc73ffa4aad9735d0e6542a6d78@sentry.igengmei.com/140"
SENTRY_CELERY_ENDPOINT
=
"http://60b0004c8884420f8067fb32fc3ed244:20f97fc73ffa4aad9735d0e6542a6d78@sentry.igengmei.com/140"
BROKER_URL
=
"redis://127.0.0.1:6379/8"
BROKER_URL
=
"redis://127.0.0.1:6379/8"
#
CELERY_SEND_EVENTS = True
CELERY_SEND_EVENTS
=
True
#
CELERY_SEND_TASK_SENT_EVENT = True
CELERY_SEND_TASK_SENT_EVENT
=
True
#
#
#
CELERY_DEFAULT_EXCHANGE = 'celery'
CELERY_DEFAULT_EXCHANGE
=
'celery'
#
CELERY_DEFAULT_EXCHANGE_TYPE = 'direct'
CELERY_DEFAULT_EXCHANGE_TYPE
=
'direct'
#
CELERY_DEFAULT_ROUTING_KEY = 'celery'
CELERY_DEFAULT_ROUTING_KEY
=
'celery'
#
#
# CELERY_QUEUES = {
# CELERY_QUEUES = {
# 'celery': {
# 'celery': {
...
...
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