mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-09-29 00:32:06 +08:00
update genshin
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
from gino import Gino
|
||||
from .log import logger
|
||||
from configs.config import bind, sql_name, user, password, address, port, database
|
||||
from .service_config import DATABASE_URI
|
||||
|
||||
|
||||
# 全局数据库连接对象
|
||||
@@ -10,7 +11,7 @@ db = Gino()
|
||||
|
||||
|
||||
async def init():
|
||||
i_bind = bind
|
||||
i_bind = DATABASE_URI if DATABASE_URI else bind
|
||||
if not bind:
|
||||
i_bind = f"{sql_name}://{user}:{password}@{address}:{port}/{database}"
|
||||
# print(i_bind)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import os
|
||||
|
||||
|
||||
try:
|
||||
DATABASE_URI = os.environ['DATABASE_URI']
|
||||
except KeyError:
|
||||
DATABASE_URI = ''
|
||||
|
||||
try:
|
||||
TL_M_KEY = os.environ['TL_KEY']
|
||||
except KeyError:
|
||||
TL_M_KEY = []
|
||||
|
||||
Reference in New Issue
Block a user