# -*- coding:utf-8 -*-
from datetime import timedelta
from celery.schedules import crontab

ALLOWED_HOSTS = ["192.168.78.2"]

SECRET_KEY = 'e%$v6snev0807=t0@gk_n2#r5m6r1h(eil6cp^y3ub@ja@gk_t'
SENTRY_CELERY_ENDPOINT = "http://60b0004c8884420f8067fb32fc3ed244:20f97fc73ffa4aad9735d0e6542a6d78@sentry.igengmei.com/140"

BROKER_URL = "redis://redis.paas.env:6379/8"

REDIS_URL = "redis://redis.paas.env:6379/13"

CELERY_BROKER_URL = "redis://redis.paas.env:6379/8"

DATABASES = {
    'default': {
        # 'ENGINE': 'django.db.backends.mysql',
        # 'NAME': 'zhengxing_test',
        # 'USER': 'work',
        # 'PASSWORD': 'workwork',
        # 'HOST': 'rdsmaqevmuzj6jy.mysql.rds.aliyuncs.com',
        # 'PORT': '',
        # 'OPTIONS': {
        #     "init_command": "SET foreign_key_checks = 0;",
        #     "charset": "utf8mb4",
        # }
        'ENGINE': 'django.db.backends.mysql',  # 设置为mysql数据库
        'NAME': 'zhengxing_test',
        'USER': 'work',
        'PASSWORD': 'Gengmei1',
        'HOST': 'rm-2ze0v6uua2hl9he8edo.mysql.rds.aliyuncs.com',
        'PORT': '3306',
        'OPTIONS': {
            "init_command": "SET foreign_key_checks = 0;",
            "charset": "utf8mb4",  # 为了支持emoji表情
        },
    },
    'bran': {
        'ENGINE': 'django.db.backends.mysql',  # 设置为mysql数据库
        'NAME': 'bran_test',
        'USER': 'work',
        'PASSWORD': 'workwork',
        'HOST': 'rdsmaqevmuzj6jy.mysql.rds.aliyuncs.com',
        'PORT': '3306',
        'OPTIONS': {
            "init_command": "SET foreign_key_checks = 0;",
            "charset": "utf8mb4",  # 为了支持emoji表情
        },
    }
}

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'trans2es',
    'search',
    'injection.data_sync',
)

CELERYBEAT_SCHEDULE = {
    'set_tag_count': {
        'task': 'injection.data_sync.tasks.set_data_to_redis',
        'schedule': timedelta(seconds=10),
        'args': ()
    },
}

# ES_INFO_LIST = [
#     {
#         "host": "101.200.54.249",
#         "port": 9200
#     }
# ]
#
GM_ORI_ES_INFO_LIST = [
    {
        "host": "101.200.54.249",
        "port": 9200
    }
]

ES_INFO_LIST = [
    {
        "host": "127.0.0.1",
        "port": 9200
    }
]
#
# GM_ORI_ES_INFO_LIST = [
#     {
#         "host": "127.0.0.1",
#         "port": 9200
#     }
# ]

ES_INDEX_PREFIX = "gm_test"
