parent
00f63a2470
commit
32e9488161
@ -1,19 +1,48 @@
|
|||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
# 数据库配置
|
# 数据库配置
|
||||||
MYSQL_CONFIG = {
|
ENV = os.getenv('ENV', 'dev') # 默认环境为dev
|
||||||
'host': '10.10.14.101',
|
|
||||||
'port': 3306,
|
if ENV == 'prod':
|
||||||
'user': 'ylt',
|
MYSQL_CONFIG = {
|
||||||
'password': 'Ycharge666',
|
'host': '10.10.14.101',
|
||||||
'database': 'yltcharge',
|
'port': 3306,
|
||||||
'charset': 'utf8mb4'
|
'user': 'ylt',
|
||||||
}
|
'password': 'Ycharge666',
|
||||||
|
'database': 'yltcharge',
|
||||||
|
'charset': 'utf8mb4'
|
||||||
|
}
|
||||||
|
|
||||||
CH_CONFIG = {
|
CH_CONFIG = {
|
||||||
'host': '10.10.14.250',
|
'host': '10.10.14.250',
|
||||||
'port': 9000,
|
'port': 9000,
|
||||||
'settings': {
|
'settings': {
|
||||||
'max_insert_block_size': 100000,
|
'max_insert_block_size': 100000,
|
||||||
'async_insert': 1,
|
'async_insert': 1,
|
||||||
'wait_for_async_insert': 0
|
'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,
|
||||||
|
'settings': {
|
||||||
|
'max_insert_block_size': 100000,
|
||||||
|
'async_insert': 1,
|
||||||
|
'wait_for_async_insert': 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def print_config():
|
||||||
|
print("当前配置:")
|
||||||
|
print(f"环境: {os.getenv('ENV', 'dev')}")
|
Loading…
Reference in new issue