<commit_before># -*- coding: utf-8 -*-
# http://google-styleguide.googlecode.com/svn/trunk/pyguide.html

import os
import multiprocessing
from kombu import Queue
from smsgw.lib.utils import get_sql_alchemy_db_uri, get_rabbitmq_uri


SERVER_NAME = os.environ.get('NGINX_HOSTNAME')

DEBUG = os.environ.get('DEBUG', False)
TESTING = os.environ.get('TESTING', False)
STATIC_FOLDER = os.path.join('static')
SECRET_KEY = os.urandom(24)

# Logging
LOGGING = bool(os.environ.get('LOGGING', False))
LOGGING_EMAIL_BLACKLIST = {
    # TODO(vojta) figure out what endpoints should be blacklisted
}

# Database
DATABASE_DIALECT = 'mysql'
DATABASE_HOST = os.environ.get('DATABASE_HOST', 'db')
DATABASE_PORT = os.environ.get('DATABASE_PORT', 3306)
DATABASE_USERNAME = os.environ.get('DATABASE_USERNAME')
DATABASE_PASSWORD = <PASSWORD>('DATABASE_PASSWORD')
DATABASE_NAME = os.environ.get('DATABASE_NAME')
SQLALCHEMY_DATABASE_URI = get_sql_alchemy_db_uri(
    dialect=DATABASE_DIALECT,
    host=DATABASE_HOST,
    port=DATABASE_PORT,
    username=DATABASE_USERNAME,
    password=<PASSWORD>,
    database=DATABASE_NAME
)
# http://stackoverflow.com/questions/18054224/python-sqlalchemy-mysql-server-has-gone-away
SQLALCHEMY_POOL_RECYCLE = 3600

# RabbitMQ
RABBITMQ_HOST = os.environ.get('RABBITMQ_HOST', 'rabbitmq')
RABBITMQ_VHOST = os.environ.get('RABBITMQ_DEFAULT_VHOST', 'smsgw')
RABBITMQ_USER = os.environ.get('RABBITMQ_DEFAULT_USER', 'guest')
RABBITMQ_PASSWORD = os.environ.get('RABBITMQ_DEFAULT_PASS', 'guest')

# Mail
MAIL_DEFAULT = os.environ.get('MAIL_DEFAULT', '<EMAIL>')
MAIL_DEBUG = os.environ.get('MAIL_DEBUG', '<EMAIL>')
MAILGUN_DOMAIN = os.environ.get('MAILGUN_DOMAIN')
MAILGUN_API_KEY = os.environ.get('MAILGUN_API_KEY')

# CELERY
CELERY_IMPORTS = ("smsgw.tasks.callback", "smsgw.tasks.mail")
CELERY_TIMEZONE = 'UTC'
CELERY_BROKER_URL = get_rabbitmq_uri(
    host=RABBITMQ_HOST,
    vhost=RABBITMQ_VHOST,
    user=RABBITMQ_USER,
    password=<PASSWORD>
)
CELERY_RESULT_BACKEND = None
CELERY_IGNORE_RESULT = True
CELERY_QUEUES = (Queue('callbacks', routing_key='callbacks'),
                 Queue('mails', routing_key='mails'))<commit_msg>Settings: changing sqlalchemy pool recycle to 15minutes<commit_after># -*- coding: utf-8 -*-
# http://google-styleguide.googlecode.com/svn/trunk/pyguide.html

import os
import multiprocessing
from kombu import Queue
from smsgw.lib.utils import get_sql_alchemy_db_uri, get_rabbitmq_uri


SERVER_NAME = os.environ.get('NGINX_HOSTNAME')

DEBUG = os.environ.get('DEBUG', False)
TESTING = os.environ.get('TESTING', False)
STATIC_FOLDER = os.path.join('static')
SECRET_KEY = os.urandom(24)

# Logging
LOGGING = bool(os.environ.get('LOGGING', False))
LOGGING_EMAIL_BLACKLIST = {
    # TODO(vojta) figure out what endpoints should be blacklisted
}

# Database
DATABASE_DIALECT = 'mysql'
DATABASE_HOST = os.environ.get('DATABASE_HOST', 'db')
DATABASE_PORT = os.environ.get('DATABASE_PORT', 3306)
DATABASE_USERNAME = os.environ.get('DATABASE_USERNAME')
DATABASE_PASSWORD = os.environ.get('DATABASE_PASSWORD')
DATABASE_NAME = os.environ.get('DATABASE_NAME')
SQLALCHEMY_DATABASE_URI = get_sql_alchemy_db_uri(
    dialect=DATABASE_DIALECT,
    host=DATABASE_HOST,
    port=DATABASE_PORT,
    username=DATABASE_USERNAME,
    password=<PASSWORD>,
    database=DATABASE_NAME
)
# http://stackoverflow.com/questions/18054224/python-sqlalchemy-mysql-server-has-gone-away
SQLALCHEMY_POOL_RECYCLE = 900

# RabbitMQ
RABBITMQ_HOST = os.environ.get('RABBITMQ_HOST', 'rabbitmq')
RABBITMQ_VHOST = os.environ.get('RABBITMQ_DEFAULT_VHOST', 'smsgw')
RABBITMQ_USER = os.environ.get('RABBITMQ_DEFAULT_USER', 'guest')
RABBITMQ_PASSWORD = os.environ.get('RABBITMQ_DEFAULT_PASS', 'guest')

# Mail
MAIL_DEFAULT = os.environ.get('MAIL_DEFAULT', '<EMAIL>')
MAIL_DEBUG = os.environ.get('MAIL_DEBUG', '<EMAIL>')
MAILGUN_DOMAIN = os.environ.get('MAILGUN_DOMAIN')
MAILGUN_API_KEY = os.environ.get('MAILGUN_API_KEY')

# CELERY
CELERY_IMPORTS = ("smsgw.tasks.callback", "smsgw.tasks.mail")
CELERY_TIMEZONE = 'UTC'
CELERY_BROKER_URL = get_rabbitmq_uri(
    host=RABBITMQ_HOST,
    vhost=RABBITMQ_VHOST,
    user=RABBITMQ_USER,
    password=RABBITMQ_PASSWORD
)
CELERY_RESULT_BACKEND = None
CELERY_IGNORE_RESULT = True
CELERY_QUEUES = (Queue('callbacks', routing_key='callbacks'),
                 Queue('mails', routing_key='mails'))
{'fraction_non_alphanumeric': 0.12974098057354302, 'fraction_numerical': 0.009019426456984274, 'mean_word_length': 6.293423271500843, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7415626', 'n_tokens_mistral': 1778, 'n_tokens_neox': 1739, 'n_words': 231}