|
|
|
@ -58,7 +58,6 @@ opt = None
|
|
|
|
|
model = None
|
|
|
|
|
avatar = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#####webrtc###############################
|
|
|
|
|
pcs = set()
|
|
|
|
|
|
|
|
|
@ -98,7 +97,7 @@ def set_enable_status(db_path):
|
|
|
|
|
"UPDATE live_config SET value = '1' WHERE key = 'livetlking_enable_status';"
|
|
|
|
|
)
|
|
|
|
|
conn.commit()
|
|
|
|
|
print("enable_status 对应的 value 字段改为 '1'")
|
|
|
|
|
print("livetlking_enable_status 对应的 value 字段改为 '1'")
|
|
|
|
|
finally:
|
|
|
|
|
conn.close()
|
|
|
|
|
|
|
|
|
@ -310,6 +309,12 @@ async def on_shutdown(app):
|
|
|
|
|
coros = [pc.close() for pc in pcs]
|
|
|
|
|
await asyncio.gather(*coros)
|
|
|
|
|
pcs.clear()
|
|
|
|
|
# 关闭数据库连接
|
|
|
|
|
global conn
|
|
|
|
|
if conn:
|
|
|
|
|
conn.close()
|
|
|
|
|
print("[INFO] 已关闭数据库连接")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def post(url,data):
|
|
|
|
|
try:
|
|
|
|
@ -344,7 +349,7 @@ async def run(push_url,sessionid):
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
try:
|
|
|
|
|
db_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'live_chat.db')
|
|
|
|
|
db_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', 'live_chat.db')
|
|
|
|
|
|
|
|
|
|
load_db_config(db_path)
|
|
|
|
|
|
|
|
|
|