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
c0e07516
Commit
c0e07516
authored
Feb 20, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ad
parent
59e9675f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
20 deletions
+21
-20
__init__.py
physical/__init__.py
+3
-1
celery_task_router.py
physical/celery_task_router.py
+9
-8
settings.py
physical/settings.py
+9
-11
No files found.
physical/__init__.py
View file @
c0e07516
...
...
@@ -4,4 +4,6 @@ import pymysql
from
_celery
import
app
as
celery_app
pymysql
.
install_as_MySQLdb
()
#__all__ = ('celery_app',)
__all__
=
(
'celery_app'
,)
physical/celery_task_router.py
View file @
c0e07516
# coding=utf-8
from
__future__
import
unicode_literals
,
print_function
,
absolute_import
import
itertools
from
django.conf
import
settings
from
__future__
import
unicode_literals
,
print_function
,
absolute_import
import
itertools
from
django.conf
import
settings
import
logging
class
CeleryTaskRouter
(
object
):
queue_task_map
=
{
"tapir-alpha"
:[
"tapir-alpha"
:
[
'injection.data_sync.tasks.write_to_es'
,
'injection.data_sync.tasks.sync_face_similar_data_to_redis'
,
]
}
...
...
@@ -30,4 +32,4 @@ class CeleryTaskRouter(object):
logging
.
info
(
"duan add,task is:
%
s"
%
str
(
task
))
queue_name_or_none
=
self
.
task_queue_map
.
get
(
task
)
return
queue_name_or_none
\ No newline at end of file
return
queue_name_or_none
physical/settings.py
View file @
c0e07516
...
...
@@ -18,7 +18,6 @@ from celery.schedules import crontab
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
...
...
@@ -30,9 +29,8 @@ DEBUG = False
ALLOWED_HOSTS
=
[]
# 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"
# CELERY_SEND_EVENTS = True
...
...
@@ -64,8 +62,8 @@ INSTALLED_APPS = (
'django.contrib.sessions'
,
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'trans2es'
,
'search'
,
'trans2es'
,
'search'
,
'injection.data_sync'
,
)
...
...
@@ -145,7 +143,7 @@ DATABASES = {
'PASSWORD'
:
'Gengmei123'
,
'HOST'
:
'rm-2ze5k2we69904787l.mysql.rds.aliyuncs.com'
,
'PORT'
:
'3306'
,
#'CONN_MAX_AGE': None,
#
'CONN_MAX_AGE': None,
'OPTIONS'
:
{
"init_command"
:
"SET foreign_key_checks = 0;"
,
"charset"
:
"utf8mb4"
,
...
...
@@ -154,13 +152,13 @@ DATABASES = {
}
ES_INFO_LIST
=
[
{
"host"
:
"10.29.130.141"
,
"port"
:
9200
}
{
"host"
:
"10.29.130.141"
,
"port"
:
9200
}
]
ES_INDEX_PREFIX
=
"gm-dbmw"
ES_INDEX_PREFIX
=
"gm-dbmw"
MIDDLEWARE_CLASSES
=
(
'gm_tracer.middleware.TracerMiddleware'
,
...
...
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