Commit c0e07516 authored by lixiaofang's avatar lixiaofang

ad

parent 59e9675f
...@@ -4,4 +4,6 @@ import pymysql ...@@ -4,4 +4,6 @@ import pymysql
from _celery import app as celery_app from _celery import app as celery_app
pymysql.install_as_MySQLdb() pymysql.install_as_MySQLdb()
#__all__ = ('celery_app',) __all__ = ('celery_app',)
# 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',
'injection.data_sync.tasks.sync_face_similar_data_to_redis',
] ]
} }
...@@ -30,4 +32,4 @@ class CeleryTaskRouter(object): ...@@ -30,4 +32,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
...@@ -18,7 +18,6 @@ from celery.schedules import crontab ...@@ -18,7 +18,6 @@ from celery.schedules import crontab
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production # Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/ # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
...@@ -30,9 +29,8 @@ DEBUG = False ...@@ -30,9 +29,8 @@ DEBUG = False
ALLOWED_HOSTS = [] 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
...@@ -64,8 +62,8 @@ INSTALLED_APPS = ( ...@@ -64,8 +62,8 @@ INSTALLED_APPS = (
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'trans2es', 'trans2es',
'search', 'search',
'injection.data_sync', 'injection.data_sync',
) )
...@@ -145,7 +143,7 @@ DATABASES = { ...@@ -145,7 +143,7 @@ DATABASES = {
'PASSWORD': 'Gengmei123', 'PASSWORD': 'Gengmei123',
'HOST': 'rm-2ze5k2we69904787l.mysql.rds.aliyuncs.com', 'HOST': 'rm-2ze5k2we69904787l.mysql.rds.aliyuncs.com',
'PORT': '3306', 'PORT': '3306',
#'CONN_MAX_AGE': None, # 'CONN_MAX_AGE': None,
'OPTIONS': { 'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;", "init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4", "charset": "utf8mb4",
...@@ -154,13 +152,13 @@ DATABASES = { ...@@ -154,13 +152,13 @@ DATABASES = {
} }
ES_INFO_LIST = [ ES_INFO_LIST = [
{ {
"host": "10.29.130.141", "host": "10.29.130.141",
"port": 9200 "port": 9200
} }
] ]
ES_INDEX_PREFIX="gm-dbmw" ES_INDEX_PREFIX = "gm-dbmw"
MIDDLEWARE_CLASSES = ( MIDDLEWARE_CLASSES = (
'gm_tracer.middleware.TracerMiddleware', 'gm_tracer.middleware.TracerMiddleware',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment