You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.2 KiB

import os
# 数据库配置
ENV = os.getenv('ENV', 'dev') # 默认环境为dev
if ENV == 'prod':
MYSQL_CONFIG = {
'host': '10.10.14.101',
'port': 3306,
'user': 'ylt',
'password': 'Ycharge666',
'database': 'yltcharge',
'charset': 'utf8mb4'
}
CH_CONFIG = {
'host': '10.10.14.250',
'port': 9000,
'settings': {
'max_insert_block_size': 100000,
'async_insert': 1,
'wait_for_async_insert': 0
}
}
else:
MYSQL_CONFIG = {
'host': '10.10.14.101',
'port': 3306,
'user': 'ylt',
'password': 'Ycharge666',
'database': 'yltcharge',
'charset': 'utf8mb4'
}
CH_CONFIG = {
'host': '10.10.14.250',
'port': 9000,
'user': 'default',
'password': 'DsideaL147258369',
'database': 'default',
'settings': {
'max_insert_block_size': 100000,
'async_insert': 1,
'wait_for_async_insert': 0
}
}
def print_config():
print("当前配置:")
print(f"环境: {os.getenv('ENV', 'dev')}")